browseflow.flow.html.hook.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. $class = $currentApp ? '' : "class='active'";
  3. $method = 'browseFlow';
  4. $featurabar = "<div id='featurebar'><ul class='nav'>";
  5. $featurabar .= "<li $class>" . baseHTML::a(inlink($method, "mode=$mode&status=&app=&orderBy=$orderBy"), $lang->workflow->all) . '</li>';
  6. $flowApps = $this->workflow->getFlowApps();
  7. foreach($flowApps as $appCode)
  8. {
  9. $appName = zget($apps, $appCode, '');
  10. if($appCode == 'project') $appName = $lang->project->common;
  11. if(!$appName) continue;
  12. $class = $appCode == $currentApp ? "class='active'" : '';
  13. $featurabar .= "<li $class>" . baseHTML::a(inlink($method, "mode=$mode&status=&app=$appCode&orderBy=$orderBy"), $appName) . '</li>';
  14. }
  15. $featurabar .= "</ul></div>";
  16. ?>
  17. <script>
  18. $(function()
  19. {
  20. if($('#featurebar').length == 0) $('#main .container').prepend(<?php echo json_encode($featurabar);?>);
  21. $('a[disabled=disabled]').addClass('disabled');
  22. $('.deleter').attr('data-toggle', 'ajax');
  23. $('#bysearchTab').remove();
  24. $('.btn-browse').each(function()
  25. {
  26. var flowApp = $(this).parents('.flow-block').data('flowapp');
  27. if(flowApp == 'scrum' || flowApp == 'waterfall' || flowApp == 'kanbanProject') flowApp = 'project';
  28. $(this).attr('href', $(this).attr('href') + '#app=' + flowApp);
  29. });
  30. });
  31. var $projectTR = $('#workflowTable tr[data-module=project]');
  32. if(!$projectTR.find('td').eq(3).html()) $projectTR.find('td').eq(3).html('<?php echo $lang->project->common;?>');
  33. $projectTR.find('td').eq(1).attr('title', '<?php echo $lang->project->common;?>');
  34. $projectTR.find('td').eq(1).find('a').html('<?php echo $lang->project->common;?>');
  35. var $executionTR = $('#workflowTable tr[data-module=execution]');
  36. $executionTR.find('td').eq(1).attr('title', '<?php echo $lang->execution->common;?>');
  37. $executionTR.find('td').eq(1).find('a').html('<?php echo $lang->execution->common;?>');
  38. $('#cardMode .panel[data-flowapp=project]').find('.panel-body .info div > .text-primary').html('<?php echo $lang->project->common;?>');
  39. var $projectCard = $('div.footerbar[data-module=project]').closest('#flowBlock');
  40. $projectCard.find('.panel-heading strong.title').attr('title', '<?php echo $lang->project->common;?>');
  41. $projectCard.find('.panel-heading strong.title').html('<?php echo $lang->project->common;?> ' + $projectCard.find('.panel-heading strong.title').find('span').prop('outerHTML'));
  42. var $executionCard = $('div.footerbar[data-module=execution]').closest('#flowBlock');
  43. $executionCard.find('.panel-heading strong.title').attr('title', '<?php echo $lang->execution->common;?>');
  44. $executionCard.find('.panel-heading strong.title').html('<?php echo $lang->execution->common;?> ' + $executionCard.find('.panel-heading strong.title').find('span').prop('outerHTML'));
  45. </script>