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


PHP CustomFields::store方法代码示例

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


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

示例1: 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

示例2: CustomFields

} else {
    $isNotNew = @$_POST['event_id'];
    if (!$isNotNew) {
        $obj->event_owner = $AppUI->user_id;
    }
    // Check for existence of clashes.
    if ($_POST['event_assigned'] > '' && ($clash = $obj->checkClash($_POST['event_assigned']))) {
        $last_a = $a;
        $GLOBALS['a'] = "clash";
        $do_redirect = false;
    } else {
        if ($msg = $obj->store()) {
            $AppUI->setMsg($msg, UI_MSG_ERROR);
        } else {
            $custom_fields = new CustomFields('calendar', 'addedit', $obj->event_id, "edit");
            $custom_fields->bind($_POST);
            $sql = $custom_fields->store($obj->event_id);
            // Store Custom Fields
            $AppUI->setMsg($isNotNew ? 'updated' : 'added', UI_MSG_OK, true);
            if (isset($_POST['event_assigned'])) {
                $obj->updateAssigned(explode(",", $_POST['event_assigned']));
            }
            if (isset($_POST['mail_invited'])) {
                $obj->notify(@$_POST['event_assigned'], $isNotNew);
            }
        }
    }
}
if ($do_redirect) {
    $AppUI->redirect();
}
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:do_event_aed.php

示例3: 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

示例4: CustomFields

if (!$obj->bind($_POST)) {
    $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
require_once $AppUI->getSystemClass('CustomFields');
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('Company');
if ($del) {
    if (!$obj->canDelete($msg)) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    }
    if ($msg = $obj->delete()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    } else {
        $AppUI->setMsg('deleted', UI_MSG_ALERT, true);
        $AppUI->redirect('m=companies');
    }
} else {
    if ($msg = $obj->store()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
    } else {
        $custom_fields = new CustomFields($m, 'addedit', $obj->company_id, 'edit');
        $custom_fields->bind($_POST);
        $sql = $custom_fields->store($obj->company_id);
        // Store Custom Fields
        $AppUI->setMsg(@$_POST['company_id'] ? 'updated' : 'added', UI_MSG_OK, true);
    }
    $AppUI->redirect();
}
开发者ID:hoodoogurus,项目名称:dotprojecteap,代码行数:31,代码来源:do_company_aed.php

示例5: CustomFields

     if ($msg = $obj->delete()) {
         $AppUI->setMsg($msg, UI_MSG_ERROR);
         $AppUI->redirect();
     } else {
         $AppUI->setMsg('Task deleted');
         $AppUI->redirect('', -1);
     }
 } else {
     if ($msg = $obj->store()) {
         $AppUI->setMsg($msg, UI_MSG_ERROR);
         $AppUI->redirect();
         // Store failed don't continue?
     } else {
         $custom_fields = new CustomFields($m, 'addedit', $obj->task_id, "edit");
         $custom_fields->bind($_POST);
         $sql = $custom_fields->store($obj->task_id);
         // Store Custom Fields
         $AppUI->setMsg($task_id ? 'Task updated' : 'Task added', UI_MSG_OK);
     }
     if (isset($hassign)) {
         $obj->updateAssigned($hassign, $hperc_assign_ar);
     }
     if (isset($hdependencies)) {
         $obj->updateDependencies($hdependencies);
     }
     // If there is a set of post_save functions, then we process them
     if (isset($post_save)) {
         foreach ($post_save as $post_save_function) {
             $post_save_function();
         }
     }
开发者ID:Esleelkartea,项目名称:gestion-de-primeras-muestras,代码行数:31,代码来源:do_task_aed.php

示例6: CustomFields

// check permissions for this record
if (!$contact_id) {
    echo $AppUI->_('You are not authorized to use this page. If you should be authorized please contact Bruce Bodger to give you another valid link, thank you.');
    exit;
}
if (!$contact->bind($_POST)) {
    $AppUI->setMsg($contact->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
// prepare (and translate) the module name ready for the suffix
$AppUI->setMsg('Contact');
$isNotNew = $_POST['contact_id'];
if ($msg = $contact->store($AppUI)) {
    $AppUI->setMsg($msg, UI_MSG_ERROR);
    $msg = $AppUI->_('There was an error recording your contact data, please contact the system administrator. Thank you very much.');
} else {
    $custom_fields = new CustomFields('contacts', 'addedit', $contact->contact_id, 'edit', 1);
    $custom_fields->bind($_POST);
    $custom_fields->store($contact->contact_id);
    $contact->clearUpdateKey();
    $AppUI->setMsg($isNotNew ? 'updated' : 'added', UI_MSG_OK, true);
    echo $AppUI->_('Your contact data has been recorded successfully. Your may now close your browser windoq.  Thank you very much, ' . $contact->contact_first_name);
}
?>
<html>
	<body>
		<?php 
echo $msg;
?>
	</body>
</html>
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:do_updatecontact.php

示例7: store

 public function store(CAppUI $AppUI = null)
 {
     global $AppUI;
     $perms = $AppUI->acl();
     $stored = false;
     $this->w2PTrimAll();
     $this->project_target_budget = str_replace(',', '', $this->project_target_budget);
     // ensure changes of state in checkboxes is captured
     $this->project_active = (int) $this->project_active;
     $this->project_private = (int) $this->project_private;
     $this->project_target_budget = $this->project_target_budget ? $this->project_target_budget : 0.0;
     $this->project_actual_budget = $this->project_actual_budget ? $this->project_actual_budget : 0.0;
     // Make sure project_short_name is the right size (issue for languages with encoded characters)
     if (mb_strlen($this->project_short_name) > 10) {
         $this->project_short_name = mb_substr($this->project_short_name, 0, 10);
     }
     if (empty($this->project_end_date)) {
         $this->project_end_date = null;
     }
     $errorMsgArray = $this->check();
     if (count($errorMsgArray) > 0) {
         return $errorMsgArray;
     }
     $this->project_id = (int) $this->project_id;
     // convert dates to SQL format first
     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();
         }
     }
//.........这里部分代码省略.........
开发者ID:joly,项目名称:web2project,代码行数:101,代码来源:projects.class.php

示例8: CustomFields

        $AppUI->redirect();
    } else {
        $AppUI->setMsg('deleted', UI_MSG_ALERT, true);
        $AppUI->redirect('m=contacts');
    }
} else {
    if ($result = $obj->store($AppUI)) {
        if (is_array($result)) {
            $AppUI->setMsg($result, UI_MSG_ERROR, true);
            $AppUI->holdObject($obj);
            $AppUI->redirect('m=contacts&a=addedit');
        }
    } else {
        $custom_fields = new CustomFields($m, 'addedit', $obj->contact_id, 'edit');
        $custom_fields->bind($_POST);
        $sql = $custom_fields->store($obj->contact_id);
        // Store Custom Fields
        $updatekey = $obj->getUpdateKey();
        if ($notifyasked && !$updatekey) {
            $rnow = new CDate();
            $obj->contact_updatekey = MD5($rnow->format(FMT_DATEISO));
            $obj->contact_updateasked = $rnow->format(FMT_DATETIME_MYSQL);
            $obj->contact_lastupdate = '';
            $obj->updateNotify();
        } elseif ($notifyasked && $updatekey) {
        } else {
            $obj->contact_updatekey = '';
        }
        $obj->store($AppUI);
        $AppUI->setMsg($isNotNew ? 'updated' : 'added', UI_MSG_OK, true);
    }
开发者ID:joly,项目名称:web2project,代码行数:31,代码来源:do_contact_aed.php


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