edit.max.html.hook.php 635 B

12345678910111213141516171819
  1. <?php
  2. namespace zin;
  3. if(helper::hasFeature('deliverable'))
  4. {
  5. global $lang, $app;
  6. $execution = data('execution');
  7. $hasDeliverable = false;
  8. if($execution->status == 'closed' && !empty($execution->deliverable) && $app->control->loadModel('project')->checkUploadedDeliverable($execution->id)) $hasDeliverable = true;
  9. query('formGridPanel')->each(function($node) use ($hasDeliverable)
  10. {
  11. $fields = $node->prop('fields');
  12. $fields->field('attribute')->disabled($hasDeliverable);
  13. $fields->field('lifetime')->disabled($hasDeliverable);
  14. $node->setProp('fields', $fields);
  15. });
  16. }