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


PHP CustomFields::bind方法代码示例

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


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

示例1: store

 public function store(CAppUI $AppUI)
 {
     $perms = $AppUI->acl();
     $stored = false;
     $errorMsgArray = $this->check();
     if (count($errorMsgArray) > 0) {
         return $errorMsgArray;
     }
     $this->company_id = (int) $this->company_id;
     /*
      * TODO: I don't like the duplication on each of these two branches, but I
      *   don't have a good idea on how to fix it at the moment...
      */
     if ($this->company_id && $perms->checkModuleItem('companies', 'edit', $this->company_id)) {
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('companies', $this->company_id, 'update', $this->company_name, $this->company_id);
         $stored = true;
     }
     if (0 == $this->company_id && $perms->checkModuleItem('companies', 'add')) {
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('companies', $this->company_id, 'add', $this->company_name, $this->company_id);
         $stored = true;
     }
     if ($stored) {
         $custom_fields = new CustomFields('companies', 'addedit', $this->company_id, 'edit');
         $custom_fields->bind($_POST);
         $sql = $custom_fields->store($this->company_id);
         // Store Custom Fields
     }
     return $stored;
 }
开发者ID:joly,项目名称:web2project,代码行数:35,代码来源:companies.class.php

示例2: dPgetParam

// prepare (and translate) the module name ready for the suffix
if ($del) {
    $project_id = dPgetParam($_POST, 'project_id', 0);
    $canDelete = $obj->canDelete($msg, $project_id);
    if (!$canDelete) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    }
    if ($msg = $obj->delete()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    } else {
        $AppUI->setMsg("Project deleted", UI_MSG_ALERT);
        $AppUI->redirect("m=projects");
    }
} else {
    if ($msg = $obj->store()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
    } else {
        $isNotNew = @$_POST['project_id'];
        if ($importTask_projectId = dPgetParam($_POST, 'import_tasks_from', '0')) {
            $obj->importTasks($importTask_projectId);
        }
        $AppUI->setMsg($isNotNew ? 'Project updated' : 'Project inserted', UI_MSG_OK, true);
        $custom_fields = new CustomFields($m, 'addedit', $obj->project_id, "edit");
        $custom_fields->bind($_POST);
        $sql = $custom_fields->store($obj->project_id);
        // Store Custom Fields
    }
    $AppUI->redirect();
}
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:do_project_aed.php

示例3: store


//.........这里部分代码省略.........
     if ($this->project_start_date) {
         $date = new CDate($this->project_start_date);
         $this->project_start_date = $date->format(FMT_DATETIME_MYSQL);
     }
     if ($this->project_end_date) {
         $date = new CDate($this->project_end_date);
         $date->setTime(23, 59, 59);
         $this->project_end_date = $date->format(FMT_DATETIME_MYSQL);
     }
     if ($this->project_actual_end_date) {
         $date = new CDate($this->project_actual_end_date);
         $this->project_actual_end_date = $date->format(FMT_DATETIME_MYSQL);
     }
     // let's check if there are some assigned departments to project
     if ('' != $this->project_actual_end_date) {
         $obj->project_departments = implode(',', w2PgetParam($_POST, 'dept_ids', array()));
     }
     // check project parents and reset them to self if they do not exist
     if (!$this->project_parent) {
         $this->project_parent = $this->project_id;
         $this->project_original_parent = $this->project_id;
     } else {
         $parent_project = new CProject();
         $parent_project->load($this->project_parent);
         $this->project_original_parent = $parent_project->project_original_parent;
     }
     if (!$this->project_original_parent) {
         $this->project_original_parent = $this->project_id;
     }
     /*
      * TODO: I don't like the duplication on each of these two branches, but I
      *   don't have a good idea on how to fix it at the moment...
      */
     if ($this->project_id && $perms->checkModuleItem('projects', 'edit', $this->company_id)) {
         $q = new DBQuery();
         $this->project_updated = $q->dbfnNow();
         if ($msg = parent::store()) {
             return $msg;
         }
         addHistory('projects', $this->project_id, 'update', $this->project_name, $this->project_id);
         $stored = true;
     }
     if (0 == $this->project_id && $perms->checkModuleItem('projects', 'add')) {
         $q = new DBQuery();
         $this->project_updated = $q->dbfnNow();
         $this->project_created = $q->dbfnNow();
         if ($msg = parent::store()) {
             return $msg;
         }
         if (0 == $this->project_parent || 0 == $this->project_original_parent) {
             $this->project_parent = $this->project_id;
             $this->project_original_parent = $this->project_id;
             if ($msg = parent::store()) {
                 return $msg;
             }
         }
         addHistory('projects', $this->project_id, 'add', $this->project_name, $this->project_id);
         $stored = true;
     }
     //split out related departments and store them seperatly.
     $q = new DBQuery();
     $q->setDelete('project_departments');
     $q->addWhere('project_id=' . (int) $this->project_id);
     $q->exec();
     $q->clear();
     if ($this->project_departments) {
         $departments = explode(',', $this->project_departments);
         foreach ($departments as $department) {
             $q->addTable('project_departments');
             $q->addInsert('project_id', $this->project_id);
             $q->addInsert('department_id', $department);
             $q->exec();
             $q->clear();
         }
     }
     //split out related contacts and store them seperatly.
     $q->setDelete('project_contacts');
     $q->addWhere('project_id=' . (int) $this->project_id);
     $q->exec();
     $q->clear();
     if ($this->project_contacts) {
         $contacts = explode(',', $this->project_contacts);
         foreach ($contacts as $contact) {
             if ($contact) {
                 $q->addTable('project_contacts');
                 $q->addInsert('project_id', $this->project_id);
                 $q->addInsert('contact_id', $contact);
                 $q->exec();
                 $q->clear();
             }
         }
     }
     if ($stored) {
         $custom_fields = new CustomFields('projects', 'addedit', $this->project_id, 'edit');
         $custom_fields->bind($_POST);
         $sql = $custom_fields->store($this->project_id);
         // Store Custom Fields
     }
     return $stored;
 }
开发者ID:joly,项目名称:web2project,代码行数:101,代码来源:projects.class.php


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