src/snac/server/database/DBUtil.php
/**
     * Modify constellation status
     *
     * Write a new version history record, updating the constellation status.
     *
     * always increment version
     * can write status 'deleted' which deletes the constellation
     * can update is_deleted and status='deleted' records (if update where is_deleted, probably best to set is_deleted to 'f')
     * returns false if $id not found
     * return false for any failure
     * return new version on success
     * write optional note if supplied
     *
     * @param \snac\data\User $user The user to perform the write status
     * @param integer $mainID A constellation ID
     * @param string $status The new status value. 'deleted' is allowed, and will cause the constellation to
     * be deleted. The status must be one of the known values.
     * @param string $note optional text note to write to the version_history table.
     * @param \snac\data\User $userSecondary The secondary user on the version update, such as "sent for review to X"
     *
     * @return integer|boolean Returns the new version number on success or false on failure.
     *
     */
Modify constellation status
Write a new version history record, updating the constellation status.



@param \snac\data\User $user The user to perform the write status
@param integer $mainID A constellation ID
@param string $status The new status value. 'deleted' is allowed, and will cause the constellation to
be deleted. The status must be one of the known values.
@param string $note optional text note to write to the version_history table.
@param \snac\data\User $userSecondary The secondary user on the version update, such as "sent for review to X"

@return integer|boolean Returns the new version number on success or false on failure.
Modify constellation status Write a new version history record updating the constellation status . @param \ snac \ data \ User $user The user to perform the write status @param integer $mainID A constellation ID @param string $status The new status value . ' deleted ' is allowed and will cause the constellation to be deleted . The status must be one of the known values . @param string $note optional text note to write to the version_history table . @param \ snac \ data \ User $userSecondary The secondary user on the version update such as " sent for review to X " @return integer|boolean Returns the new version number on success or false on failure .
public function writeConstellationStatus($user, $mainID, $status, $note="", $userSecondary=null)
    {
        if ($user == null || $user->getUserID() == null) {
            return false;
        }
        if (! $mainID)
        {
            return false;
        }
        if ($this->statusOK($status))
        {
            if (! $note)
            {
                $note = "";
            }
            $oldVersion = $this->sql->selectCurrentVersion($mainID);
            if (! $oldVersion)
            {
                return false;
            }
            $secondUserID = null;
            if ($userSecondary  != null) {
                $secondUserID = $userSecondary->getUserID();
            }
            $vhInfo = $this->sql->insertVersionHistory($mainID, $user->getUserID(), null, $status, $note, $secondUserID);
            return $vhInfo['version'];
        }
        else
        {
            $this->logDebug("DBUtil.php Error: bad status $status\n");
        }
        return false;
    }
public function writeConstellationStatus ( $ user , $ mainID , $ status , $ note = " " , $ userSecondary = null ) { if ( $ user == null || $ user -> getUserID ( ) == null ) { return false ; } if ( ! $ mainID ) { return false ; } if ( $ this -> statusOK ( $ status ) ) { if ( ! $ note ) { $ note = " " ; } $ oldVersion = $ this -> sql -> selectCurrentVersion ( $ mainID ) ; if ( ! $ oldVersion ) { return false ; } $ secondUserID = null ; if ( $ userSecondary != null ) { $ secondUserID = $ userSecondary -> getUserID ( ) ; } $ vhInfo = $ this -> sql -> insertVersionHistory ( $ mainID , $ user -> getUserID ( ) , null , $ status , $ note , $ secondUserID ) ; return $ vhInfo [ 'version' ] ; } else { $ this -> logDebug ( " DBUtil.php Error: bad status  $ status \n " ) ; } return false ; }
Modify constellation status
 Write a new version history record, updating the constellation status.
Modify constellation status Write a new version history record updating the constellation status .
/*
         * Apr 4 2016 Rather than delete via setOperation() set to delete then callign writeConstellation(),
         * allow setting the constellation status to deleted. A quick scan of the code doesn't reveal any
         * problems with this approach. So, the following if statement is commented out.
         */ /*
         * if ($status == 'deleted')
         * {
         *     return false;
         * }
         */ // Right now, we're passing null as the role ID.  We may change this to a role from the user object