<commit_before><?php
/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2014 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
*-------------------------------------------------------------------------------------------------------*
*	$Id$					    *
********************************************************************************************************/

/**
 * A single workflow. Holds all values and the reference to the concrete workflow-handler.
 * Provides methods in order to manage the existing workflows.
 *
 * @package module_workflows
 * @author <EMAIL>
 *
 * @targetTable workflows.workflows_id
 *
 * @module workflows
 * @moduleId _workflows_module_id_
 */
class class_module_workflows_workflow extends class_model implements interface_model, interface_admin_listable  {


    public static $INT_STATE_NEW = 1;
    public static $INT_STATE_SCHEDULED = 2;
    public static $INT_STATE_EXECUTED = 3;

    private $bitSaved = false;

    /**
     * @var string
     * @tableColumn workflows.workflows_class
     */
    private $strClass = "";

    /**
     * @var string
     * @tableColumn workflows.workflows_systemid
     */
    private $strAffectedSystemid = "";

    /**
     * @var int
     * @tableColumn workflows.workflows_state
     */
    private $intState = "1";

    /**
     * @var int
     * @tableColumn workflows.workflows_runs
     */
    private $intRuns = "0";

    /**
     * @var string
     * @tableColumn workflows.workflows_responsible
     */
    private $strResponsible = "";

    /**
     * @var int
     * @tableColumn workflows.workflows_int1
     */
    private $intInt1 = null;

    /**
     * @var int
     * @tableColumn workflows.workflows_int2
     */
    private $intInt2 = null;

    /**
     * @var string
     * @tableColumn workflows.workflows_char1
     * @blockEscaping
     */
    private $strChar1 = "";

    /**
     * @var string
     * @tableColumn workflows.workflows_char2
     * @blockEscaping
     */
    private $strChar2 = "";

    /**
     * @var int
     * @tableColumn workflows.workflows_date1
     */
    private $longDate1 = 0;

    /**
     * @var int
     * @tableColumn workflows.workflows_date2
     */
    private $longDate2 = 0;

    /**
     * @var string
     * @tableColumn workflows.workflows_text
     * @blockEscaping
     */
    private $strText = "";

    /**
     * @var string
     * @tableColumn workflows.workflows_text2
     * @blockEscaping
     */
    private $strText2 = "";


    /**
     * Returns the icon the be used in lists.
     * Please be aware, that only the filename should be returned, the wrapping by getImageAdmin() is
     * done afterwards.
     *
     * @return string the name of the icon, not yet wrapped by getImageAdmin(). Alternatively, you may return an array containing
     *         [the image name, the alt-title]
     */
    public function getStrIcon() {
        return "icon_workflow";
    }

    /**
     * In nearly all cases, the additional info is rendered left to the action-icons.
     *
     * @return string
     */
    public function getStrAdditionalInfo() {
        return dateToString($this->getObjTriggerDate());
    }

    /**
     * If not empty, the returned string is rendered below the common title.
     *
     * @return string
     */
    public function getStrLongDescription() {
        return "";
    }

    /**
     * Returns the name to be used when rendering the current object, e.g. in admin-lists.
     *
     * @return string
     */
    public function getStrDisplayName() {
        return $this->getObjWorkflowHandler()->getStrName();
    }


    /**
     * Creates the matching date-records
     * @return bool
     */<commit_msg>NEW: the trigger-date of a workflow is only rendered if the user has edit permissions (so for admins in most cases)<commit_after><?php
/*"******************************************************************************************************
*   (c) 2004-2006 by MulchProductions, www.mulchprod.de                                                 *
*   (c) 2007-2014 by Kajona, www.kajona.de                                                              *
*       Published under the GNU LGPL v2.1, see /system/licence_lgpl.txt                                 *
*-------------------------------------------------------------------------------------------------------*
*	$Id$					    *
********************************************************************************************************/

/**
 * A single workflow. Holds all values and the reference to the concrete workflow-handler.
 * Provides methods in order to manage the existing workflows.
 *
 * @package module_workflows
 * @author <EMAIL>
 *
 * @targetTable workflows.workflows_id
 *
 * @module workflows
 * @moduleId _workflows_module_id_
 */
class class_module_workflows_workflow extends class_model implements interface_model, interface_admin_listable  {


    public static $INT_STATE_NEW = 1;
    public static $INT_STATE_SCHEDULED = 2;
    public static $INT_STATE_EXECUTED = 3;

    private $bitSaved = false;

    /**
     * @var string
     * @tableColumn workflows.workflows_class
     */
    private $strClass = "";

    /**
     * @var string
     * @tableColumn workflows.workflows_systemid
     */
    private $strAffectedSystemid = "";

    /**
     * @var int
     * @tableColumn workflows.workflows_state
     */
    private $intState = "1";

    /**
     * @var int
     * @tableColumn workflows.workflows_runs
     */
    private $intRuns = "0";

    /**
     * @var string
     * @tableColumn workflows.workflows_responsible
     */
    private $strResponsible = "";

    /**
     * @var int
     * @tableColumn workflows.workflows_int1
     */
    private $intInt1 = null;

    /**
     * @var int
     * @tableColumn workflows.workflows_int2
     */
    private $intInt2 = null;

    /**
     * @var string
     * @tableColumn workflows.workflows_char1
     * @blockEscaping
     */
    private $strChar1 = "";

    /**
     * @var string
     * @tableColumn workflows.workflows_char2
     * @blockEscaping
     */
    private $strChar2 = "";

    /**
     * @var int
     * @tableColumn workflows.workflows_date1
     */
    private $longDate1 = 0;

    /**
     * @var int
     * @tableColumn workflows.workflows_date2
     */
    private $longDate2 = 0;

    /**
     * @var string
     * @tableColumn workflows.workflows_text
     * @blockEscaping
     */
    private $strText = "";

    /**
     * @var string
     * @tableColumn workflows.workflows_text2
     * @blockEscaping
     */
    private $strText2 = "";


    /**
     * Returns the icon the be used in lists.
     * Please be aware, that only the filename should be returned, the wrapping by getImageAdmin() is
     * done afterwards.
     *
     * @return string the name of the icon, not yet wrapped by getImageAdmin(). Alternatively, you may return an array containing
     *         [the image name, the alt-title]
     */
    public function getStrIcon() {
        return "icon_workflow";
    }

    /**
     * In nearly all cases, the additional info is rendered left to the action-icons.
     *
     * @return string
     */
    public function getStrAdditionalInfo() {
        if($this->rightEdit())
            return dateToString($this->getObjTriggerDate());
        else
            return false;
    }

    /**
     * If not empty, the returned string is rendered below the common title.
     *
     * @return string
     */
    public function getStrLongDescription() {
        return "";
    }

    /**
     * Returns the name to be used when rendering the current object, e.g. in admin-lists.
     *
     * @return string
     */
    public function getStrDisplayName() {
        return $this->getObjWorkflowHandler()->getStrName();
    }


    /**
     * Creates the matching date-records
     * @return bool
     */
{'fraction_non_alphanumeric': 0.17159618675140553, 'fraction_numerical': 0.009533121486189195, 'mean_word_length': 1.9919561243144424, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4667800', 'n_tokens_mistral': 2397, 'n_tokens_neox': 2234, 'n_words': 586}