- Timestamp:
- 06/01/10 12:16:30 (11 years ago)
- Location:
- trunk/server/www/app
- Files:
-
- 8 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/www/app/app_controller.php
r366 r367 78 78 79 79 if ($this->__permitted('users', 'admin_index')) { 80 $bottomControllers[__('Users', true)] = '/admin/users'; 81 $bottomControllers[__('Groups', true)] = '/admin/groups'; 82 $bottomControllers[__('Mimetypes', true)] = '/admin/mimetypes'; 83 $bottomControllers[__('Doctypes', true)] = '/admin/doctypes'; 84 $bottomControllers[__('Formats', true)] = '/admin/formats'; 85 $bottomControllers[__('Applications', true)] = '/admin/applications'; 86 $bottomControllers[__('Platforms', true)] = '/admin/platforms'; 87 $bottomControllers[__('Operatingsystems', true)] = '/admin/operatingsystems'; 88 $bottomControllers[__('Testsuites', true)] = '/admin/testsuites'; 80 $adminControllers[__('Users', true)] = '/admin/users'; 81 $adminControllers[__('Groups', true)] = '/admin/groups'; 82 $adminControllers[__('Requests', true)] = '/admin/requests'; 83 $adminControllers[__('Jobs', true)] = '/admin/jobs'; 84 $adminControllers[__('Factories', true)] = '/admin/factories'; 85 $adminControllers[__('Mimetypes', true)] = '/admin/mimetypes'; 86 $adminControllers[__('Doctypes', true)] = '/admin/doctypes'; 87 $adminControllers[__('Formats', true)] = '/admin/formats'; 88 $adminControllers[__('Applications', true)] = '/admin/applications'; 89 $adminControllers[__('Platforms', true)] = '/admin/platforms'; 90 $adminControllers[__('Operatingsystems', true)] = '/admin/operatingsystems'; 91 $adminControllers[__('Testsuites', true)] = '/admin/testsuites'; 89 92 } 90 93 … … 101 104 102 105 103 $this->set(compact('topControllers', 'bottomControllers', ' language'));106 $this->set(compact('topControllers', 'bottomControllers', 'adminControllers', 'language')); 104 107 } 105 108 -
trunk/server/www/app/controllers/jobs_controller.php
r338 r367 249 249 { 250 250 $this->Job->recursive = 0; 251 $this->paginate = array('order' => 'Job.id'); 251 252 $this->set('jobs', $this->paginate()); 252 }253 254 /**255 * View a single job256 *257 * @param string $id The job ID258 * @return void259 */260 public function admin_view($id = null)261 {262 if (!$id) {263 $this->Session->setFlash(__('Invalid Job.', true));264 $this->redirect(array('action'=>'index'));265 }266 $this->set('job', $this->Job->read(null, $id));267 }268 269 /**270 * Add a new job manually271 * @return void272 */273 public function admin_add()274 {275 if (!empty($this->data)) {276 $this->Job->create();277 if ($this->Job->save($this->data)) {278 $this->Session->setFlash(__('The Job has been saved', true));279 $this->redirect(array('action'=>'index'));280 } else {281 $this->Session->setFlash(__('The Job could not be saved. Please, try again.', true));282 }283 }284 $requests = $this->Job->Request->find('list');285 $platforms = $this->Job->Platform->find('list');286 $applications = $this->Job->Application->find('list');287 $factories = $this->Job->Factory->find('list');288 $results = $this->Job->Result->find('list');289 $this->set(compact('requests', 'platforms', 'applications', 'factories', 'results'));290 }291 292 /**293 * Edit a job294 *295 * @param string $id The job ID296 * @return void297 */298 public function admin_edit($id = null)299 {300 if (!$id && empty($this->data)) {301 $this->Session->setFlash(__('Invalid Job', true));302 $this->redirect(array('action'=>'index'));303 }304 if (!empty($this->data)) {305 if ($this->Job->save($this->data)) {306 $this->Session->setFlash(__('The Job has been saved', true));307 $this->redirect(array('action'=>'index'));308 } else {309 $this->Session->setFlash(__('The Job could not be saved. Please, try again.', true));310 }311 }312 if (empty($this->data)) {313 $this->data = $this->Job->read(null, $id);314 }315 $requests = $this->Job->Request->find('list');316 $platforms = $this->Job->Platform->find('list');317 $applications = $this->Job->Application->find('list');318 $factories = $this->Job->Factory->find('list');319 $results = $this->Job->Result->find('list');320 $this->set(compact('requests', 'platforms', 'applications', 'factories', 'results'));321 253 } 322 254 -
trunk/server/www/app/controllers/requests_controller.php
r364 r367 72 72 73 73 $this->Request->contain(array( 74 'User', 74 75 'Mimetype', 75 76 'Mimetype.Doctype', … … 393 394 { 394 395 $this->Request->recursive = 0; 396 $this->paginate = array('order' => 'Request.created'); 395 397 $this->set('requests', $this->paginate()); 396 398 } … … 408 410 $this->redirect(array('action'=>'index')); 409 411 } 410 $this->set('request', $this->Request->read(null, $id)); 411 } 412 413 /** 414 * Add a new request manually 415 * @return void 416 */ 417 public function admin_add() 418 { 412 413 // Used to display the jobs associated with the Request 414 $this->helpers[] = 'JobModel'; 415 416 $request = $this->_getRequest($id, 'admin'); 417 $this->set(compact('request')); 418 } 419 420 /** 421 * Edit a request 422 * 423 * @param string $id The request ID 424 * @return void 425 */ 426 public function admin_edit($id = null) 427 { 428 $request = $this->_getRequest($id, 'admin'); 429 419 430 if (!empty($this->data)) { 420 $this->data['Request']['ip_address'] = inet_ptod($this->data['Request']['ip_address']); 421 $this->Request->create(); 422 if ($this->Request->save($this->data)) { 423 $this->Session->setFlash(__('The Request has been saved', true)); 424 $this->redirect(array('action'=>'index')); 431 $this->data['Request']['id'] = $id; 432 if (!$this->Request->save($this->data)) { 433 $this->Session->setFlash(__('Unable to save the description', true)); 425 434 } else { 426 $flash = $this->Request->Behaviors->File->errors; 427 array_unshift($flash, __('The Request could not be saved. Please, try again.', true)); 428 $this->Session->setFlash(implode('<br />', $flash)); 429 } 430 } 431 $users = $this->Request->User->find('list'); 432 $mimetypes = $this->Request->Mimetype->find('list'); 433 $this->set(compact('users','mimetypes','formats')); 434 } 435 436 /** 437 * Edit a request 438 * 439 * @param string $id The request ID 440 * @return void 441 */ 442 public function admin_edit($id = null) 443 { 444 if (!$id && empty($this->data)) { 445 $this->Session->setFlash(__('Invalid Request', true)); 446 $this->redirect(array('action'=>'index')); 447 } 448 if (!empty($this->data)) { 449 $this->data['Request']['ip_address'] = inet_ptod($this->data['Request']['ip_address']); 450 if ($this->Request->save($this->data)) { 451 $this->Session->setFlash(__('The Request has been saved', true)); 452 $this->redirect(array('action'=>'index')); 453 } else { 454 $flash = $this->Request->Behaviors->File->errors; 455 array_unshift($flash, __('The Request could not be saved. Please, try again.', true)); 456 $this->Session->setFlash(implode('<br />', $flash)); 457 } 458 } 459 if (empty($this->data)) { 460 $this->data = $this->Request->read(null, $id); 461 $this->data['Request']['ip_address'] = inet_dtop($this->data['Request']['ip_address']); 462 } 463 $users = $this->Request->User->find('list'); 464 $mimetypes = $this->Request->Mimetype->find('list'); 465 $this->set(compact('users','mimetypes','formats')); 435 $this->redirect(array('action' => 'view', $id)); 436 } 437 } 438 439 $this->set(array( 440 'request' => $request, 441 )); 442 $this->render('edit'); 466 443 } 467 444 -
trunk/server/www/app/controllers/results_controller.php
r330 r367 199 199 } 200 200 201 202 public function admin_index()203 {204 $this->Result->recursive = 0;205 $this->set('results', $this->paginate());206 }207 208 201 public function admin_view($id = null) 209 202 { 210 if (!$id) { 211 $this->Session->setFlash(__('Invalid Result.', true)); 212 $this->redirect(array('action'=>'index')); 213 } 214 $this->set('result', $this->Result->read(null, $id)); 215 } 216 217 public function admin_add() 218 { 219 if (!empty($this->data)) { 220 $this->Result->create(); 221 if ($this->Result->save($this->data)) { 222 $this->Session->setFlash(__('The Result has been saved', true)); 223 $this->redirect(array('action'=>'index')); 224 } else { 225 $this->Session->setFlash(__('The Result could not be saved. Please, try again.', true)); 226 } 227 } 228 $factories = $this->Result->Factory->find('list'); 229 $formats = $this->Result->Format->find('list'); 230 $this->set(compact('factories', 'formats')); 203 $this->helpers[] = 'ResultModel'; 204 205 $this->Result->contain(array( 206 'Job', 207 'Job.Request', 208 'Job.Application', 209 'Job.Platform', 210 'Factory', 211 'Factory.User', 212 'Factory.Operatingsystem', 213 'Format', 214 'Mimetype', 215 'Validator', 216 )); 217 218 $result = $this->_getResult($id, 'admin'); 219 220 $this->set(compact('result')); 221 $this->render('view'); 231 222 } 232 223 -
trunk/server/www/app/models/request.php
r364 r367 91 91 } 92 92 93 if ($type == 'admin') { 94 return true; 95 } 96 93 97 $request = $this->find('first', array( 94 98 'contain' => array('Gallery'), … … 371 375 372 376 return true; 377 } 378 379 /** 380 * When a request is deleted, also delete the files and jobs 381 */ 382 public function beforeDelete($cascade) 383 { 384 $this->deleteJobs(); 385 $root = FILES . $this->field('root'); 386 $Folder = new Folder($root); 387 $Folder->delete(); 373 388 } 374 389 -
trunk/server/www/app/models/result.php
r330 r367 101 101 } 102 102 103 if ($type == 'admin') { 104 return true; 105 } 106 103 107 $result = $this->find('first', array( 104 108 'contain' => array('Job', 'Job.Request'), -
trunk/server/www/app/views/jobs/admin_index.ctp
r128 r367 11 11 <th><?php echo $paginator->sort('id');?></th> 12 12 <th><?php echo $paginator->sort('request_id');?></th> 13 <th><?php echo $paginator->sort('application_id');?></th> 13 14 <th><?php echo $paginator->sort('platform_id');?></th> 14 <th><?php echo $paginator->sort('application_id');?></th> 15 <th><?php echo $paginator->sort('version');?></th> 16 <th><?php echo $paginator->sort('result_id');?></th> 17 <th><?php echo $paginator->sort('factory_id');?></th> 18 <th><?php echo $paginator->sort('locked');?></th> 19 <th><?php echo $paginator->sort('created');?></th> 20 <th><?php echo $paginator->sort('updated');?></th> 15 <th><?php __('State');?></th> 21 16 <th class="actions"><?php __('Actions');?></th> 22 17 </tr> 23 <?php 24 $i = 0; 25 foreach ($jobs as $job): 26 $class = null; 27 if ($i++ % 2 == 0) { 28 $class = ' class="altrow"'; 29 } 30 ?> 31 <tr<?php echo $class;?>> 32 <td> 33 <?php echo $job['Job']['id']; ?> 18 <?php foreach ($jobs as $job):?> 19 <tr> 20 <td class="nowrap"> 21 <?php 22 if (empty($job['Result']['id'])) { 23 echo $job['Job']['id']; 24 } else { 25 echo $html->link($job['Job']['id'], array('controller' => 'result', 'action'=>'view', $job['Result']['id'])); 26 } 27 ?> 34 28 </td> 35 29 <td> … … 37 31 </td> 38 32 <td> 33 <?php 34 $application = $job['Application']['name'] . ' ' . $job['Job']['version']; 35 echo $html->link($application, array('controller'=> 'applications', 'action'=>'view', $job['Application']['id'])); 36 ?> 37 </td> 38 <td> 39 39 <?php echo $html->link($job['Platform']['name'], array('controller'=> 'platforms', 'action'=>'view', $job['Platform']['id'])); ?> 40 40 </td> 41 41 <td> 42 <?php echo $html->link($job['Application']['name'], array('controller'=> 'applications', 'action'=>'view', $job['Application']['id'])); ?> 43 </td> 44 <td> 45 <?php echo $job['Job']['version']; ?> 46 </td> 47 <td> 48 <?php echo $html->link($job['Result']['filename'], array('controller'=> 'results', 'action'=>'view', $job['Result']['id'])); ?> 49 </td> 50 <td> 51 <?php echo $html->link($job['Factory']['name'], array('controller'=> 'factories', 'action'=>'view', $job['Factory']['id'])); ?> 52 </td> 53 <td> 54 <?php echo $job['Job']['locked']; ?> 55 </td> 56 <td> 57 <?php echo $job['Job']['created']; ?> 58 </td> 59 <td> 60 <?php echo $job['Job']['updated']; ?> 42 <?php echo $jobModel->getState($job, $job['Request']['state']); ?><br /> 61 43 </td> 62 44 <td class="actions"> 63 <?php echo $html->link(__('View', true), array('action'=>'view', $job['Job']['id'])); ?>64 <?php echo $html->link(__('Edit', true), array('action'=>'edit', $job['Job']['id'])); ?>65 45 <?php echo $html->link(__('Delete', true), array('action'=>'delete', $job['Job']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $job['Job']['id'])); ?> 66 46 </td> … … 70 50 </div> 71 51 <div class="paging"> 72 <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> 73 | <?php echo $paginator->numbers();?> 74 <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?> 52 <?php echo $paginator->first('<< '.__('first', true).' ', array('escape' => false));?> 53 <?php echo $paginator->prev('< '.__('previous', true).' ', array('escape' => false), null, array('class'=>'disabled', 'escape' => false));?> 54 <?php echo $paginator->numbers();?> 55 <?php echo $paginator->next(__('next', true).' > ', array('escape' => false), null, array('class'=>'disabled', 'escape' => false));?> 56 <?php echo $paginator->last(__('last', true).' >>', array('escape' => false));?> 75 57 </div> 76 <div class="actions">77 <ul>78 <li><?php echo $html->link(__('New Job', true), array('action'=>'add')); ?></li>79 <li><?php echo $html->link(__('List Requests', true), array('controller'=> 'requests', 'action'=>'index')); ?> </li>80 <li><?php echo $html->link(__('New Request', true), array('controller'=> 'requests', 'action'=>'add')); ?> </li>81 <li><?php echo $html->link(__('List Applications', true), array('controller'=> 'applications', 'action'=>'index')); ?> </li>82 <li><?php echo $html->link(__('New Application', true), array('controller'=> 'applications', 'action'=>'add')); ?> </li>83 </ul>84 </div> -
trunk/server/www/app/views/layouts/default.ctp
r264 r367 82 82 </div> 83 83 </div> 84 <p id="admin-controllers"> 85 <?php __('Admin:');?> 86 <?php foreach ($adminControllers as $controllerName => $controllerPath): ?> 87 <a href="<?php echo $controllerPath; ?>"><?php echo $controllerName; ?></a> 88 <?php endforeach; ?> 89 </p> 84 90 <?php echo $cakeDebug; ?> 85 91 </body> -
trunk/server/www/app/views/requests/admin_index.ctp
r221 r367 12 12 <th><?php echo $paginator->sort('user_id');?></th> 13 13 <th><?php echo $paginator->sort('ip_address');?></th> 14 <th><?php echo $paginator->sort('doctype_id');?></th>15 14 <th><?php echo $paginator->sort('filename');?></th> 16 <th><?php echo $paginator->sort('path');?></th> 17 <th><?php echo $paginator->sort('mimetype');?></th> 15 <th><?php __('Jobs');?></th> 18 16 <th><?php echo $paginator->sort('created');?></th> 19 <th><?php echo $paginator->sort('modified');?></th>20 17 <th class="actions"><?php __('Actions');?></th> 21 18 </tr> 22 <?php 23 $i = 0; 24 foreach ($requests as $request): 25 $class = null; 26 if ($i++ % 2 == 0) { 27 $class = ' class="altrow"'; 28 } 29 ?> 30 <tr<?php echo $class;?>> 31 <td> 32 <?php echo $request['Request']['id']; ?> 19 <?php foreach ($requests as $request):?> 20 <tr> 21 <td class="nowrap"> 22 <?php echo $html->link($request['Request']['id'], array('action'=>'view', $request['Request']['id'])); ?> 33 23 </td> 34 24 <td> … … 39 29 </td> 40 30 <td> 41 <?php echo $html->link($request['Doctype']['name'], array('controller'=> 'doctypes', 'action'=>'view', $request['Doctype']['id'])); ?>42 </td>43 <td>44 31 <?php echo $request['Request']['filename']; ?> 45 32 </td> 46 33 <td> 47 <?php echo $request['Request']['path']; ?> 48 </td> 49 <td> 50 <?php echo $request['Request']['mimetype']; ?> 34 <?php echo $request['Request']['result_count'] . '/' . $request['Request']['job_count']; ?> 51 35 </td> 52 36 <td> 53 37 <?php echo $request['Request']['created']; ?> 54 38 </td> 55 <td>56 <?php echo $request['Request']['modified']; ?>57 </td>58 39 <td class="actions"> 59 <?php echo $html->link(__('View', true), array('action'=>'view', $request['Request']['id'])); ?>60 40 <?php echo $html->link(__('Edit', true), array('action'=>'edit', $request['Request']['id'])); ?> 61 41 <?php echo $html->link(__('Delete', true), array('action'=>'delete', $request['Request']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $request['Request']['id'])); ?> … … 66 46 </div> 67 47 <div class="paging"> 68 <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> 69 | <?php echo $paginator->numbers();?> 70 <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?> 48 <?php echo $paginator->first('<< '.__('first', true).' ', array('escape' => false));?> 49 <?php echo $paginator->prev('< '.__('previous', true).' ', array('escape' => false), null, array('class'=>'disabled', 'escape' => false));?> 50 <?php echo $paginator->numbers();?> 51 <?php echo $paginator->next(__('next', true).' > ', array('escape' => false), null, array('class'=>'disabled', 'escape' => false));?> 52 <?php echo $paginator->last(__('last', true).' >>', array('escape' => false));?> 71 53 </div> 72 54 <div class="actions"> -
trunk/server/www/app/views/requests/admin_view.ctp
r295 r367 1 1 <div class="requests view"> 2 <h2><?php __('Request');?></h2> 3 <dl> 2 <h2><?php printf(__('Filename "%s"', true), $request['Request']['filename']);?></h2> 3 <?php if ($request['Request']['state'] == Request::STATE_SCAN_FOUND): ?> 4 <img src="/img/icons/virus.png" alt="" style="float: left;" /> 5 <?php else: ?> 6 <img src="/img/icons/<?php echo $request['Mimetype']['icon'];?>" alt="" style="float: left;" /> 7 <?php endif; ?> 8 <dl style="margin-left: 10em;"> 4 9 <dt><?php __('Id'); ?></dt> 5 <dd <>10 <dd> 6 11 <?php echo $request['Request']['id']; ?> 7 12 8 13 </dd> 9 <dt><?php __(' User'); ?></dt>10 <dd <>11 <?php echo $ html->link($request['User']['email_address'], array('controller'=> 'users', 'action'=>'view', $request['User']['id']));?>14 <dt><?php __('Path'); ?></dt> 15 <dd> 16 <?php echo $request['Request']['path'] . '/' . $request['Request']['filename'];?> 12 17 13 18 </dd> 14 <dt><?php __('IP address'); ?></dt> 15 <dd<> 16 <?php echo inet_dtop($request['Request']['ip_address']); ?> 19 <dt><?php __('Uploaded'); ?></dt> 20 <dd> 21 <?php echo $request['Request']['created'];?> by 22 <?php echo $html->link($request['User']['name'], array('controller' => 'users', 'action' => 'view', $request['User']['id']));?> from IP address 23 <?php echo inet_dtop($request['Request']['ip_address']);?> 17 24 18 25 </dd> 19 <dt><?php __(' Filename'); ?></dt>20 <dd <>21 <?php echo $request ['Request']['filename']; ?>26 <dt><?php __('Status'); ?></dt> 27 <dd> 28 <?php echo $requestModel->getState($request); ?> 22 29 23 30 </dd> 24 <dt><?php __(' Path'); ?></dt>25 <dd <>26 <?php echo $request[' Request']['path']; ?>31 <dt><?php __('Document type'); ?></dt> 32 <dd> 33 <?php echo $request['Mimetype']['Doctype']['name']; ?> 27 34 28 35 </dd> 29 <dt><?php __('Mimetype'); ?></dt> 30 <dd<> 31 <?php echo $html->link($request['Mimetype']['name'], array('controller'=> 'mimetypes', 'action'=>'view', $request['Mimetype']['id'])); ?> 32 33 </dd> 34 <dt><?php __('Created'); ?></dt> 35 <dd<> 36 <?php echo $request['Request']['created']; ?> 37 38 </dd> 39 <dt><?php __('Modified'); ?></dt> 40 <dd<> 41 <?php echo $request['Request']['modified']; ?> 42 36 <?php if ($request['Validator']): ?> 37 <dt><?php __('ODF Validators'); ?></dt> 38 <dd> 39 <dl> 40 <?php foreach ($request['Validator'] as $validator): ?> 41 <dt><?php echo $validator['name']; ?></dt> 42 <dd><?php echo $validatorModel->getState($validator); ?></dd> 43 <?php endforeach; ?> 44 </dl> 45 </dd> 46 <?php endif; ?> 47 <dt><?php __('Actions'); ?></dt> 48 <dd> 49 <?php echo $html->link(__('Edit', true), array('action' => 'edit', $request['Request']['id']));?> - 50 <?php echo $html->link(__('Delete', true), array('action'=>'delete', $request['Request']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $request['Request']['id'])); ?> 43 51 </dd> 44 52 </dl> 45 53 </div> 46 <div class="actions"> 47 <ul> 48 <li><?php echo $html->link(__('Edit Request', true), array('action'=>'edit', $request['Request']['id'])); ?> </li> 49 <li><?php echo $html->link(__('Delete Request', true), array('action'=>'delete', $request['Request']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $request['Request']['id'])); ?> </li> 50 <li><?php echo $html->link(__('List Requests', true), array('action'=>'index')); ?> </li> 51 <li><?php echo $html->link(__('New Request', true), array('action'=>'add')); ?> </li> 52 <li><?php echo $html->link(__('List Users', true), array('controller'=> 'users', 'action'=>'index')); ?> </li> 53 <li><?php echo $html->link(__('New User', true), array('controller'=> 'users', 'action'=>'add')); ?> </li> 54 <li><?php echo $html->link(__('List Doctypes', true), array('controller'=> 'doctypes', 'action'=>'index')); ?> </li> 55 <li><?php echo $html->link(__('New Doctype', true), array('controller'=> 'doctypes', 'action'=>'add')); ?> </li> 56 <li><?php echo $html->link(__('List Jobs', true), array('controller'=> 'jobs', 'action'=>'index')); ?> </li> 57 <li><?php echo $html->link(__('New Job', true), array('controller'=> 'jobs', 'action'=>'add')); ?> </li> 58 </ul> 54 55 <?php 56 if (!empty($request['Request']['description_html'])) { 57 echo '<h3>' . __('Description', true) . '</h3>'; 58 echo $request['Request']['description_html']; 59 } 60 ?> 61 62 <?php if (!empty($request['Job'])):?> 63 <div class="related" id="results-list"> 64 <h3><?php __('Results');?></h3> 65 <table> 66 <tr> 67 <th><?php __('Application');?></th> 68 <th><?php __('State');?></th> 69 <th><?php __('Validators');?></th> 70 <th><?php __('Actions');?></th> 71 </tr> 72 <?php foreach ($request['Job'] as $job): ?> 73 <?php 74 $class = 'white'; 75 if ($job['Result']) { 76 switch($job['Result']['verified']) { 77 case Result::VERIFY_PASS: $class = 'green'; break; 78 case Result::VERIFY_FAIL: $class = 'red'; break; 79 } 80 } 81 echo '<tr class="' . $class . '">'; 82 ?> 83 <td class="application"> 84 <?php 85 echo $jobModel->getFormatIcon($job); 86 $app = $job['Application']['name'] . ' ' . $job['version'] 87 .= ' (' . $job['Platform']['name'] . ')'; 88 if (empty($job['Result'])) { 89 echo $app; 90 } else { 91 echo $html->link($app, array( 92 'controller' => 'results', 93 'action' => 'view', 94 $job['Result']['id'], 95 )); 96 } 97 ?> 98 </td> 99 <td> 100 <?php echo $jobModel->getState($job, $request['Request']['state']); ?><br /> 101 </td> 102 <td> 103 <?php if (isset($job['Result']['Validator'])): ?> 104 <?php foreach ($job['Result']['Validator'] as $validator) { 105 echo $validatorModel->getStateIcon($validator) . ' '; 106 } ?> 107 <?php endif;?> 108 </td> 109 <td> 110 <?php 111 echo $html->link(__('Delete', true), array( 112 'controller' => 'jobs', 113 'action' => 'delete', 114 $job['id'], 115 null, 116 sprintf(__('Are you sure you want to delete the job for %s?', true), $app) 117 )); 118 ?> 119 </td> 120 </tr> 121 <?php endforeach;?> 122 </table> 59 123 </div> 60 <div class="related"> 61 <h3><?php __('Related Jobs');?></h3> 62 <?php if (!empty($request['Job'])):?> 63 <table cellpadding = "0" cellspacing = "0"> 64 <tr> 65 <th><?php __('Id'); ?></th> 66 <th><?php __('Request Id'); ?></th> 67 <th><?php __('Application Id'); ?></th> 68 <th><?php __('Version'); ?></th> 69 <th><?php __('Created'); ?></th> 70 <th><?php __('Updated'); ?></th> 71 <th class="actions"><?php __('Actions');?></th> 72 </tr> 73 <?php 74 $i = 0; 75 foreach ($request['Job'] as $job): 76 $class = null; 77 if ($i++ % 2 == 0) { 78 $class = ' class="altrow"'; 79 } 80 ?> 81 <tr<?php echo $class;?>> 82 <td><?php echo $job['id'];?></td> 83 <td><?php echo $job['request_id'];?></td> 84 <td><?php echo $job['application_id'];?></td> 85 <td><?php echo $job['version'];?></td> 86 <td><?php echo $job['created'];?></td> 87 <td><?php echo $job['updated'];?></td> 88 <td class="actions"> 89 <?php echo $html->link(__('View', true), array('controller'=> 'jobs', 'action'=>'view', $job['id'])); ?> 90 <?php echo $html->link(__('Edit', true), array('controller'=> 'jobs', 'action'=>'edit', $job['id'])); ?> 91 <?php echo $html->link(__('Delete', true), array('controller'=> 'jobs', 'action'=>'delete', $job['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $job['id'])); ?> 92 </td> 93 </tr> 94 <?php endforeach; ?> 95 </table> 96 <?php endif; ?> 97 98 <div class="actions"> 99 <ul> 100 <li><?php echo $html->link(__('New Job', true), array('controller'=> 'jobs', 'action'=>'add'));?> </li> 101 </ul> 102 </div> 103 </div> 124 <?php endif;?> -
trunk/server/www/app/views/requests/edit.ctp
r256 r367 31 31 </div> 32 32 33 <form method="post" action="/requests/edit/<?php echo $request['Request']['id'];?>"> 33 <?php if ($this->action == 'admin_edit'):?> 34 <form method="post" action="/admin/requests/edit/<?php echo $request['Request']['id'];?>"> 35 <?php else:?> 36 <form method="post" action="/requests/edit/<?php echo $request['Request']['id'];?>"> 37 <?php endif;?> 34 38 <h3><?php __('Description');?></h3> 35 39 <div id="wmd-button-bar"></div> -
trunk/server/www/app/views/results/view.ctp
r330 r367 66 66 <dd> 67 67 <?php 68 if ($result['Result']['state'] == Result::STATE_SCAN_FOUND) { 69 echo $html->link( 70 __('Download', true), 71 array('action' => 'download', $result['Result']['id']), 72 array(), 73 sprintf(__('This document contains the "%s" virus. Are you sure?', true), $result['Result']['state_info']) 74 ); 68 if ($this->action == 'admin_view') { 69 echo $html->link(__('Delete', true), array('controller' => 'jobs', 'action' => 'delete', $result['Job']['id'])); 75 70 } else { 76 echo $html->link(__('Download', true), array('action' => 'download', $result['Result']['id'])); 77 } 71 if ($result['Result']['state'] == Result::STATE_SCAN_FOUND) { 72 echo $html->link( 73 __('Download', true), 74 array('action' => 'download', $result['Result']['id']), 75 array(), 76 sprintf(__('This document contains the "%s" virus. Are you sure?', true), $result['Result']['state_info']) 77 ); 78 } else { 79 echo $html->link(__('Download', true), array('action' => 'download', $result['Result']['id'])); 80 } 78 81 79 if ($writeAccess) { 80 if ($result['Factory']['id']) { 81 echo ' - ' . $html->link(__('Edit', true), array('controller' => 'results', 'action' => 'edit', $result['Result']['id'])); 82 } else { 83 echo ' - ' . $html->link(__('Edit', true), array('controller' => 'jobs', 'action' => 'edit', $result['Job']['id'])); 82 if ($writeAccess) { 83 if ($result['Factory']['id']) { 84 echo ' - ' . $html->link(__('Edit', true), array('controller' => 'results', 'action' => 'edit', $result['Result']['id'])); 85 } else { 86 echo ' - ' . $html->link(__('Edit', true), array('controller' => 'jobs', 'action' => 'edit', $result['Job']['id'])); 87 } 88 echo ' - ' . $html->link(__('Delete', true), array('controller' => 'jobs', 'action' => 'delete', $result['Job']['id'])); 84 89 } 85 echo ' - ' . $html->link(__('Delete', true), array('controller' => 'jobs', 'action' => 'delete', $result['Job']['id']));86 90 } 87 91 ?> -
trunk/server/www/app/webroot/css/cake.override.css
r334 r367 69 69 } 70 70 71 #top-controllers a, #top-controllers a:hover, #bottom-controllers a, #bottom-controllers a:hover { 71 #admin-controllers { 72 margin-bottom: 10px; 73 font-size: small; 74 text-align: center; 75 color: #333333; 76 } 77 78 #admin-controllers a { 79 font-weight: normal; 80 } 81 82 #top-controllers a, #top-controllers a:hover, #bottom-controllers a, #bottom-controllers a:hover, #admin-controllers a, #admin-controllers a:hover { 72 83 color: #17509d; 73 84 background-color: transparent; … … 81 92 text-align: left; 82 93 margin-bottom: 0.5em; 94 color: #333333; 83 95 } 84 96 … … 263 275 span.hi { background-color: #bbb; } 264 276 dd dt { padding-left: 0; } 277 td.nowrap { white-space: nowrap; }
Note: See TracChangeset
for help on using the changeset viewer.