Exemplo n.º 1
0
 /**
  * Get the action links for this page.
  *
  * @param null
  *
  * @return  array   array of action links that we need to display for the browse screen
  * @access public
  */
 static function &actionLinks()
 {
     // check if variable _actionsLinks is populated
     if (!isset(self::$_actionLinks)) {
         // helper variable for nicer formatting
         $deleteExtra = ts('Are you sure you want to delete this workflow?');
         $copyExtra = ts('Are you sure you want to make a copy of this workflow?');
         self::$_actionLinks = array(CRM_Core_Action::BROWSE => array('name' => ts('View and Edit Steps'), 'url' => 'civicrm/workflows/profiles', 'qs' => 'reset=1&action=browse&wid=%%wid%%', 'title' => ts('View and Edit Steps')), CRM_Core_Action::UPDATE => array('name' => ts('Settings'), 'url' => 'civicrm/workflows/update', 'qs' => 'action=update&reset=1&wid=%%wid%%', 'title' => ts('Edit Workflow Settings')), CRM_Core_Action::VIEW => array('name' => ts('Workflow Link'), 'url' => 'civicrm/workflow', 'qs' => 'wid=%%wid%%&reset=1', 'title' => ts('Link to the Workflow page')), CRM_Core_Action::DISABLE => array('name' => ts('Disable'), 'url' => CRM_Utils_System::currentPath(), 'qs' => 'action=disable&wid=%%wid%%&reset=1', 'title' => ts('Disable Workflow')), CRM_Core_Action::ENABLE => array('name' => ts('Enable'), 'url' => CRM_Utils_System::currentPath(), 'qs' => 'action=enable&wid=%%wid%%&reset=1', 'title' => ts('Enable Workflow')), CRM_Core_Action::DELETE => array('name' => ts('Delete'), 'url' => CRM_Utils_System::currentPath(), 'qs' => 'action=delete&reset=1&wid=%%wid%%', 'title' => ts('Delete Workflow'), 'extra' => 'onclick = "return confirm(\'' . $deleteExtra . '\');"'), CRM_Core_Action::COPY => array('name' => ts('Clone Workflow'), 'url' => CRM_Utils_System::currentPath(), 'qs' => 'action=copy&reset=1&wid=%%wid%%', 'title' => ts('Make a Copy of this workflow'), 'extra' => 'onclick = "return confirm(\'' . $copyExtra . '\');"'));
     }
     return self::$_actionLinks;
 }
Exemplo n.º 2
0
 static function getWorkflows()
 {
     $sql = "SELECT * FROM civicrm_workflow";
     $dao =& CRM_Core_DAO::executeQuery($sql, array());
     $allLinks = CRM_Workflow_Page_Workflow_List::actionLinks();
     while ($dao->fetch()) {
         $result[$dao->id] = (array) $dao;
         // form all action links
         $action = array_sum(array_keys($allLinks));
         // update enable/disable links depending on price_set properties.
         if ($dao->is_active) {
             $action -= CRM_Core_Action::ENABLE;
         } else {
             $action -= CRM_Core_Action::DISABLE;
         }
         $actionLinks = $allLinks;
         //CRM-10117
         $result[$dao->id]['action'] = CRM_Core_Action::formLink($actionLinks, $action, array('wid' => $dao->id), ts('more'), FALSE, 'workflow.row.actions', 'Workflow', $dao->id);
     }
     return empty($result) ? false : $result;
 }