[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_workflow/tmpl/workflows/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_workflow
   6   *
   7   * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   * @since       4.0.0
  10   */
  11  
  12  defined('_JEXEC') or die;
  13  
  14  use Joomla\CMS\Factory;
  15  use Joomla\CMS\HTML\HTMLHelper;
  16  use Joomla\CMS\Language\Text;
  17  use Joomla\CMS\Layout\LayoutHelper;
  18  use Joomla\CMS\Router\Route;
  19  use Joomla\CMS\Session\Session;
  20  
  21  /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
  22  $wa = $this->document->getWebAssetManager();
  23  $wa->useScript('table.columns')
  24      ->useScript('multiselect');
  25  
  26  $listOrder = $this->escape($this->state->get('list.ordering'));
  27  $listDirn  = $this->escape($this->state->get('list.direction'));
  28  
  29  $saveOrder = $listOrder == 'w.ordering';
  30  
  31  $orderingColumn = 'created';
  32  $saveOrderingUrl = '';
  33  
  34  if (strpos($listOrder, 'modified') !== false) {
  35      $orderingColumn = 'modified';
  36  }
  37  
  38  if ($saveOrder) {
  39      $saveOrderingUrl = 'index.php?option=com_workflow&task=workflows.saveOrderAjax&tmpl=component&extension=' . $this->escape($this->extension) . '&' . Session::getFormToken() . '=1';
  40      HTMLHelper::_('draggablelist.draggable');
  41  }
  42  
  43  $extension = $this->escape($this->state->get('filter.extension'));
  44  
  45  $user = Factory::getUser();
  46  $userId = $user->id;
  47  ?>
  48  <form action="<?php echo Route::_('index.php?option=com_workflow&view=workflows&extension=' . $extension); ?>" method="post" name="adminForm" id="adminForm">
  49      <div class="row">
  50          <?php if (!empty($this->sidebar)) : ?>
  51              <div id="j-sidebar-container" class="col-md-2">
  52                  <?php echo $this->sidebar; ?>
  53              </div>
  54          <?php endif; ?>
  55          <div class="<?php if (!empty($this->sidebar)) {
  56              echo 'col-md-10';
  57                      } else {
  58                          echo 'col-md-12';
  59                      } ?>">
  60              <div id="j-main-container" class="j-main-container">
  61                  <?php
  62                      // Search tools bar
  63                      echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this, 'options' => array('selectorFieldName' => 'extension')));
  64                  ?>
  65                  <?php if (empty($this->workflows)) : ?>
  66                      <div class="alert alert-info">
  67                          <span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  68                          <?php echo Text::_('JGLOBAL_NO_MATCHING_RESULTS'); ?>
  69                      </div>
  70                  <?php else : ?>
  71                      <table class="table">
  72                          <caption class="visually-hidden">
  73                              <?php echo Text::_('COM_WORKFLOW_WORKFLOWS_TABLE_CAPTION'); ?>,
  74                              <span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
  75                              <span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
  76                          </caption>
  77                          <thead>
  78                              <tr>
  79                                  <td class="w-1 text-center d-none d-md-table-cell">
  80                                      <?php echo HTMLHelper::_('grid.checkall'); ?>
  81                                  </td>
  82                                  <th scope="col" class="w-1 text-center d-none d-md-table-cell">
  83                                      <?php echo HTMLHelper::_('searchtools.sort', '', 'w.ordering', $listDirn, $listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-sort'); ?>
  84                                  </th>
  85                                  <th scope="col" class="w-1 text-center">
  86                                      <?php echo HTMLHelper::_('searchtools.sort', 'JSTATUS', 'w.published', $listDirn, $listOrder); ?>
  87                                  </th>
  88                                  <th scope="col">
  89                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_WORKFLOW_NAME', 'w.title', $listDirn, $listOrder); ?>
  90                                  </th>
  91                                  <th scope="col" class="w-10 text-center d-none d-md-table-cell">
  92                                      <?php echo Text::_('COM_WORKFLOW_DEFAULT'); ?>
  93                                  </th>
  94                                  <th scope="col" class="w-10 text-center d-none d-md-table-cell">
  95                                      <?php echo Text::_('COM_WORKFLOW_COUNT_STAGES'); ?>
  96                                  </th>
  97                                  <th scope="col" class="w-10 text-center d-none d-md-table-cell">
  98                                      <?php echo Text::_('COM_WORKFLOW_COUNT_TRANSITIONS'); ?>
  99                                  </th>
 100                                  <th scope="col" class="w-10 d-none d-md-table-cell">
 101                                      <?php echo HTMLHelper::_('searchtools.sort', 'COM_WORKFLOW_ID', 'w.id', $listDirn, $listOrder); ?>
 102                                  </th>
 103                              </tr>
 104                          </thead>
 105                          <tbody <?php if ($saveOrder) :
 106                              ?> class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="<?php echo strtolower($listDirn); ?>" data-nested="false"<?php
 107                                 endif; ?>>
 108                          <?php foreach ($this->workflows as $i => $item) :
 109                              $states = Route::_('index.php?option=com_workflow&view=stages&workflow_id=' . $item->id . '&extension=' . $extension);
 110                              $transitions = Route::_('index.php?option=com_workflow&view=transitions&workflow_id=' . $item->id . '&extension=' . $extension);
 111                              $edit = Route::_('index.php?option=com_workflow&task=workflow.edit&id=' . $item->id . '&extension=' . $extension);
 112  
 113                              $canEdit    = $user->authorise('core.edit', $extension . '.workflow.' . $item->id);
 114                              $canCheckin = $user->authorise('core.admin', 'com_workflow') || $item->checked_out == $userId || is_null($item->checked_out);
 115                              $canEditOwn = $user->authorise('core.edit.own', $extension . '.workflow.' . $item->id) && $item->created_by == $userId;
 116                              $canChange  = $user->authorise('core.edit.state', $extension . '.workflow.' . $item->id) && $canCheckin;
 117                              ?>
 118                              <tr class="row<?php echo $i % 2; ?>" data-draggable-group="0">
 119                                  <td class="text-center d-none d-md-table-cell">
 120                                      <?php echo HTMLHelper::_('grid.id', $i, $item->id, false, 'cid', 'cb', Text::_($item->title)); ?>
 121                                  </td>
 122                                  <td class="text-center d-none d-md-table-cell">
 123                                      <?php
 124                                      $iconClass = '';
 125                                      if (!$canChange) {
 126                                          $iconClass = ' inactive';
 127                                      } elseif (!$saveOrder) {
 128                                          $iconClass = ' inactive" title="' . Text::_('JORDERINGDISABLED');
 129                                      }
 130                                      ?>
 131                                      <span class="sortable-handler<?php echo $iconClass ?>">
 132                                          <span class="icon-ellipsis-v" aria-hidden="true"></span>
 133                                      </span>
 134                                      <?php if ($canChange && $saveOrder) : ?>
 135                                          <input type="text" name="order[]" size="5" value="<?php echo $item->ordering; ?>" class="width-20 text-area-order hidden">
 136                                      <?php endif; ?>
 137                                  </td>
 138                                  <td class="text-center">
 139                                      <?php echo HTMLHelper::_('jgrid.published', $item->published, $i, 'workflows.', $canChange); ?>
 140                                  </td>
 141                                  <th scope="row">
 142                                      <?php if ($item->checked_out) : ?>
 143                                          <?php echo HTMLHelper::_('jgrid.checkedout', $i, $item->editor, $item->checked_out_time, 'workflows.', $canCheckin); ?>
 144                                      <?php endif; ?>
 145                                      <?php if ($canEdit || $canEditOwn) : ?>
 146                                          <a href="<?php echo $edit; ?>" title="<?php echo Text::_('JACTION_EDIT', true); ?> <?php echo Text::_($item->title, true); ?>">
 147                                              <?php echo $this->escape(Text::_($item->title)); ?>
 148                                          </a>
 149                                          <div class="small"><?php echo $item->description; ?></div>
 150                                      <?php else : ?>
 151                                          <?php echo $this->escape(Text::_($item->title)); ?>
 152                                          <div class="small"><?php echo $item->description; ?></div>
 153                                      <?php endif; ?>
 154                                  </th>
 155                                  <td class="text-center d-none d-md-table-cell">
 156                                      <?php echo HTMLHelper::_('jgrid.isdefault', $item->default, $i, 'workflows.', $canChange); ?>
 157                                  </td>
 158                                  <td class="text-center btns d-none d-md-table-cell itemnumber">
 159                                      <a class="btn <?php echo ($item->count_states > 0) ? 'btn-warning' : 'btn-secondary'; ?>"
 160                                          href="<?php echo Route::_('index.php?option=com_workflow&view=stages&workflow_id=' . (int) $item->id . '&extension=' . $extension); ?>" aria-describedby="tip-stages<?php echo $i; ?>">
 161                                          <?php echo $item->count_states; ?>
 162                                      </a>
 163                                      <div role="tooltip" id="tip-stages<?php echo $i; ?>">
 164                                          <?php echo Text::_('COM_WORKFLOW_COUNT_STAGES'); ?>
 165                                      </div>
 166                                  </td>
 167                                  <td class="text-center btns d-none d-md-table-cell itemnumber">
 168                                      <a class="btn <?php echo ($item->count_transitions > 0) ? 'btn-info' : 'btn-secondary'; ?>"
 169                                          href="<?php echo Route::_('index.php?option=com_workflow&view=transitions&workflow_id=' . (int) $item->id . '&extension=' . $extension); ?>" aria-describedby="tip-transitions<?php echo $i; ?>">
 170                                          <?php echo $item->count_transitions; ?>
 171                                      </a>
 172                                      <div role="tooltip" id="tip-transitions<?php echo $i; ?>">
 173                                          <?php echo Text::_('COM_WORKFLOW_COUNT_TRANSITIONS'); ?>
 174                                      </div>
 175                                  </td>
 176                                  <td class="d-none d-md-table-cell">
 177                                      <?php echo $item->id; ?>
 178                                  </td>
 179                              </tr>
 180                          <?php endforeach ?>
 181                      </table>
 182                      <?php // load the pagination. ?>
 183                      <?php echo $this->pagination->getListFooter(); ?>
 184  
 185                  <?php endif; ?>
 186                  <input type="hidden" name="task" value="">
 187                  <input type="hidden" name="boxchecked" value="0">
 188                  <?php echo HTMLHelper::_('form.token'); ?>
 189              </div>
 190          </div>
 191      </div>
 192  </form>


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer