当前位置: 首页>>代码示例>>PHP>>正文


PHP G::GenerateUniqueID方法代码示例

本文整理汇总了PHP中G::GenerateUniqueID方法的典型用法代码示例。如果您正苦于以下问题:PHP G::GenerateUniqueID方法的具体用法?PHP G::GenerateUniqueID怎么用?PHP G::GenerateUniqueID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在G的用法示例。


在下文中一共展示了G::GenerateUniqueID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createFolder

    /**
     *
     * @param string $folderName
     * @param strin(32) $folderParent
     * @return Ambigous <>|number
     */
    public function createFolder ($folderName, $folderParent = "/", $action = "createifnotexists")
    {
        $validActions = array ("createifnotexists","create","update");
        if (! in_array( $action, $validActions )) {
            $action = "createifnotexists";
        }

        //Clean Folder and Parent names (delete spaces...)
        $folderName = trim( $folderName );
        $folderParent = trim( $folderParent );
        //Try to Load the folder (Foldername+FolderParent)
        $oCriteria = new Criteria( 'workflow' );
        $oCriteria->add( AppFolderPeer::FOLDER_NAME, $folderName );
        $oCriteria->add( AppFolderPeer::FOLDER_PARENT_UID, $folderParent );
        $oDataset = AppFolderPeer::doSelectRS( $oCriteria );
        $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
        $oDataset->next();
        if ($aRow = $oDataset->getRow()) {
            //Folder exist, then return the ID
            $response['success'] = false;
            $response['message'] = $response['error'] = "Can't create folder <br /> A folder with same name already exist. <br /> $folderName";
            $response['folderUID'] = $aRow['FOLDER_UID'];
            //return ($aRow ['FOLDER_UID']);
            return ($response);
        } else {
            //Folder doesn't exist. Create and return the ID
            $folderUID = G::GenerateUniqueID();
            $tr = new AppFolder();
            $tr->setFolderUid( $folderUID );
            $tr->setFolderParentUid( $folderParent );
            $tr->setFolderName( $folderName );
            $tr->setFolderCreateDate( 'now' );
            $tr->setFolderUpdateDate( 'now' );
            if ($tr->validate()) {
                // we save it, since we get no validation errors, or do whatever else you like.
                $res = $tr->save();
                $response['success'] = true;
                $response['message'] = "Folder successfully created. <br /> $folderName";
                $response['folderUID'] = $folderUID;
                return ($response);
                //return $folderUID;
            } else {
                // Something went wrong. We can now get the validationFailures and handle them.
                $msg = '';
                $validationFailuresArray = $tr->getValidationFailures();
                foreach ($validationFailuresArray as $objValidationFailure) {
                    $msg .= $objValidationFailure->getMessage() . "<br/>";
                }
                $response['success'] = false;
                $response['message'] = $response['error'] = "Can't create folder \n A  \n " . $msg;
                return ($response);
            }
        }
    }
开发者ID:rrsc,项目名称:processmaker,代码行数:60,代码来源:AppFolder.php

示例2: isset

     $oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
     $oCriteria->add(ProcessCategoryPeer::CATEGORY_NAME, $catName);
     $oDataset = ProcessCategoryPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     $row = $oDataset->getRow();
     $response = isset($row['CATEGORY_NAME']) ? 'false' : 'true';
     echo $response;
     break;
 case 'saveNewCategory':
     try {
         require_once 'classes/model/ProcessCategory.php';
         $catName = trim($_REQUEST['category']);
         $pcat = new ProcessCategory();
         $pcat->setNew(true);
         $pcat->setCategoryUid(G::GenerateUniqueID());
         $pcat->setCategoryName($catName);
         $pcat->save();
         G::auditLog("CreateCategory", "Category Name: " . $catName);
         echo '{success: true}';
     } catch (Exception $ex) {
         echo '{success: false, error: ' . $ex->getMessage() . '}';
     }
     break;
 case 'checkEditCategoryName':
     require_once 'classes/model/ProcessCategory.php';
     $catUID = $_REQUEST['cat_uid'];
     $catName = $_REQUEST['cat_name'];
     $oCriteria = new Criteria('workflow');
     $oCriteria->addSelectColumn(ProcessCategoryPeer::CATEGORY_NAME);
     $oCriteria->add(ProcessCategoryPeer::CATEGORY_NAME, $catName);
开发者ID:emildev35,项目名称:processmaker,代码行数:31,代码来源:processCategory_Ajax.php

示例3: Publisher

<?php

if ($RBAC->userCanAccess('PM_SETUP') != 1 && $RBAC->userCanAccess('PM_SETUP_ADVANCE') != 1) {
    G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
    //G::header('location: ../login/login');
    die;
}
require_once "classes/model/ProcessCategory.php";
$fields['CATEGORY_UID'] = G::GenerateUniqueID();
$fields['CATEGORY_PARENT'] = '';
$fields['CATEGORY_NAME'] = '';
$fields['CATEGORY_ICON'] = '';
$G_MAIN_MENU = 'workflow';
$G_SUB_MENU = 'processCategory';
$G_ID_MENU_SELECTED = '';
$G_ID_SUB_MENU_SELECTED = '';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processCategory/processCategoryNew', '', $fields, 'processCategorySave');
G::RenderPage('publishBlank', 'blank');
开发者ID:nshong,项目名称:processmaker,代码行数:19,代码来源:processCategoryNew.php

示例4: calendarEdit

 /**
  * CALENDAR
  * getting default list
  *
  * @param string $httpData->PRO_UID (opional)
  */
 public function calendarEdit($httpData)
 {
     global $RBAC;
     //$RBAC->requirePermissions('PM_SETUP_ADVANCE');
     G::LoadClass('configuration');
     G::LoadClass('calendar');
     $CalendarUid = str_replace('"', '', isset($_GET['id']) ? $_GET['id'] : G::GenerateUniqueID());
     $calendarObj = new calendar();
     if (isset($_GET['id']) && $_GET['id'] != "") {
         $fields = $calendarObj->getCalendarInfoE($CalendarUid);
         $fields['OLD_NAME'] = $fields['CALENDAR_NAME'];
     }
     // For a new Calendar
     if (!isset($fields['CALENDAR_UID'])) {
         $fields['CALENDAR_UID'] = $CalendarUid;
         $fields['OLD_NAME'] = '';
         //Default Business Hour
         $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_DAY'] = 7;
         $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_START'] = "09:00";
         $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_END'] = "17:00";
     }
     // Copy Calendar
     if (isset($_GET['cp']) && $_GET['cp'] == 1) {
         $fields['CALENDAR_UID'] = G::GenerateUniqueID();
         $fields['CALENDAR_NAME'] = G::LoadTranslation("ID_COPY_OF") . " " . $fields['CALENDAR_NAME'];
         $fields['OLD_NAME'] = $fields['CALENDAR_NAME'];
     }
     $c = new Configurations();
     $configPage = $c->getConfiguration('additionalTablesList', 'pageSize', '', $_SESSION['USER_LOGGED']);
     $Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
     $this->includeExtJS('admin/calendarEdit');
     $this->setView('admin/calendarEdit');
     $businessDayArray = array();
     for ($i = 0; $i < sizeof($fields['BUSINESS_DAY']); $i++) {
         $businessDayArray[$i] = $fields['BUSINESS_DAY'][$i + 1];
     }
     $fields['BUSINESS_DAY'] = $businessDayArray;
     //validating if the calendar is new, it means that we don't have the $_GET array
     $fields['HOLIDAY'] = isset($_GET['id']) && $_GET['id'] != '' ? $fields['HOLIDAY'] : array();
     $holidayArray = array();
     for ($i = 0; $i < sizeof($fields['HOLIDAY']); $i++) {
         $holidayArray[$i] = $fields['HOLIDAY'][$i + 1];
     }
     $_GET['id'] = isset($_GET['id']) && $_GET['id'] != '' ? $_GET['id'] : '';
     $fields['HOLIDAY'] = $holidayArray;
     $fields['NEWCALENDAR'] = 'NO';
     if (isset($_GET['id']) && $_GET['id'] == '') {
         $fields['CALENDAR_UID'] = G::GenerateUniqueID();
         $fields['NEWCALENDAR'] = 'YES';
     }
     $this->setJSVar('CALENDAR_UID', $fields['CALENDAR_UID']);
     $this->setJSVar('fields', $fields);
     G::RenderPage('publish', 'extJs');
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:60,代码来源:admin.php

示例5: str_replace

    die;
}
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'setup';
$G_ID_MENU_SELECTED = 'SETUP';
$G_ID_SUB_MENU_SELECTED = 'CALENDAR';
$CalendarUid = str_replace('"', '', isset($_GET['id']) ? $_GET['id'] : G::GenerateUniqueID());
//TODO: Add validation before save for all fields
G::LoadClass('calendar');
$calendarObj = new calendar();
if (isset($_GET['id']) && $_GET['id'] != "") {
    $fields = $calendarObj->getCalendarInfoE($CalendarUid);
    $fields['OLD_NAME'] = $fields['CALENDAR_NAME'];
}
if (!isset($fields['CALENDAR_UID'])) {
    //For a new Calendar
    $fields['CALENDAR_UID'] = $CalendarUid;
    $fields['OLD_NAME'] = '';
    //Default Business Hour
    $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_DAY'] = 7;
    $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_START'] = "09:00";
    $fields['BUSINESS_DAY'][1]['CALENDAR_BUSINESS_END'] = "17:00";
}
if (isset($_GET['cp']) && $_GET['cp'] == 1) {
    // Copy Calendar
    $fields['CALENDAR_UID'] = G::GenerateUniqueID();
    $fields['CALENDAR_NAME'] = G::LoadTranslation("ID_COPY_OF") . " " . $fields['CALENDAR_NAME'];
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'setup/calendarEdit', '', $fields, 'calendarSave');
G::RenderPage('publishBlank', 'blank');
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:calendarEdit.php

示例6: Publisher

<?php

require_once "classes/model/AppFolder.php";
$fields['FOLDER_UID'] = G::GenerateUniqueID();
$fields['FOLDER_PARENT_UID'] = '';
$fields['FOLDER_NAME'] = '';
$fields['FOLDER_CREATE_DATE'] = '';
$fields['FOLDER_UPDATE_DATE'] = '';
$G_MAIN_MENU = 'workflow';
$G_SUB_MENU = 'appFolder';
$G_ID_MENU_SELECTED = '';
$G_ID_SUB_MENU_SELECTED = '';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'appFolder/appFolderEdit', '', $fields, 'appFolderSave');
G::RenderPage('publish');
开发者ID:emildev35,项目名称:processmaker,代码行数:15,代码来源:appFolderNew.php

示例7: newFolder

function newFolder()
{
    require_once ("classes/model/AppFolder.php");
    $oPMFolder = new AppFolder ();
    //G::pr($_POST);
    if ($_POST ['dir']=="") {
        $_POST ['dir']="/";
    }
    if ($_POST ['dir']=="root") {
        $_POST ['dir']="/";
    }
    $folderStructure = $oPMFolder->getFolderStructure ($_POST ['dir']);
    //G::pr($folderStructure);
    $folderPath = $folderStructure ['PATH'];
    $parentUid = $_POST ['dir'];
    $folderUid = G::GenerateUniqueID ();

    $formNewFolder=array();

    $formNewFolder["xtype"]="form";
    $formNewFolder["id"]= "simpleform";
    $formNewFolder["labelWidth"]=125;
    $formNewFolder["url"]="../appFolder/appFolderAjax.php";
    $formNewFolder["dialogtitle"]= G::LoadTranslation('ID_CREATE_FOLDER');
    $formNewFolder["frame"]= true;
    $formNewFolder["items"]= array();

    $field=array();
    $field["xtype"]= "label";
    $field["fieldLabel"]= "Path";
    $field["name"]= "form[FOLDER_PATH]";
    $field["id"]= "form[FOLDER_PATH]";
    $field["width"]=175;
    $field["allowBlank"]=false;
    $field["value"]=$folderPath;
    $field["text"]=$folderPath;
    $formNewFolder["items"][]= $field;

    $field=array();
    $field["xtype"]= "hidden";
    $field["fieldLabel"]= "Uid";
    $field["name"]= "form[FOLDER_UID]";
    $field["id"]= "form[FOLDER_UID]";
    $field["width"]=175;
    $field["allowBlank"]=false;
    $field["value"]=$folderUid;
    $formNewFolder["items"][]= $field;

    $field=array();
    $field["xtype"]= "hidden";
    $field["fieldLabel"]= "Parent";
    $field["name"]= "form[FOLDER_PARENT_UID]";
    $field["id"]= "form[FOLDER_PARENT_UID]";
    $field["width"]=175;
    $field["allowBlank"]=false;
    $field["value"]=$parentUid;
    $formNewFolder["items"][]= $field;

    $field=array();
    $field["xtype"]= "textfield";
    $field["fieldLabel"]= "Name";
    $field["name"]= "form[FOLDER_NAME]";
    $field["id"]= "form[FOLDER_NAME]";
    $field["width"]=175;
    $field["allowBlank"]=false;
    $formNewFolder["items"][]= $field;

    $formNewFolder["buttons"]= array();

    $button                     = array();
    $button["text"]             = "Create";
    $button["handler"]          = 'handlerCreate';
    $formNewFolder["buttons"][] = $button;

    $button=array();
    $button["text"]= "Cancel";
    $button["handler"]= 'handlerCancel';
    $formNewFolder["buttons"][]= $button;

    $handlerCreate='function() {
                statusBarMessage("Please wait...", true,true);
                Ext.getCmp("simpleform").getForm().submit({
                    //reset: true,
                    reset: false,
                    waitTitle : "&nbsp;",
                    success: function(form, action) {
                        statusBarMessage(action.result.message, false, true);
                        try{
                            dirTree.getSelectionModel().getSelectedNode().reload();
                        } catch(e) {}
                        datastore.reload();
                        Ext.getCmp("dialog").destroy();
                    },
                    failure: function(form, action) {
                        if(!action.result) return;
                        Ext.Msg.alert("Error!", action.result.error);
                        statusBarMessage(action.result.error, false, false);
                    },
                    scope: Ext.getCmp("simpleform"),
                    // add some vars to the request, similar to hidden fields
//.........这里部分代码省略.........
开发者ID:rrsc,项目名称:processmaker,代码行数:101,代码来源:appFolderAjax.php


注:本文中的G::GenerateUniqueID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。