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


PHP Controller::save方法代码示例

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


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

示例1: save

 public function save()
 {
     if (parent::save($this->modeltype)) {
         sendTo($this->name, 'view', $this->_modules, array('id' => $this->saved_model->id));
     }
     $this->refresh();
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:7,代码来源:TicketingController.php

示例2: save

 public function save()
 {
     $flash = Flash::Instance();
     $errors = array();
     $db = DB::Instance();
     $db->StartTrans();
     if (isset($this->_data['permission'])) {
         $permissions = $this->_data['permission'];
         unset($this->_data['permission']);
     } else {
         $permissions = array();
     }
     if (isset($this->_data['admin'])) {
         $admin = $this->_data['admin'];
         unset($this->_data['admin']);
     } else {
         $admin = array();
     }
     if (parent::save('Role')) {
         $role = $this->saved_model;
         if (isset($this->_data['Role']['users']) && is_array($this->_data['Role']['users'])) {
             $users = $this->_data['Role']['users'];
             Role::setUsers($role, $users, $errors);
             $flash->addErrors($errors);
         }
         if ($role->setPermissions($permissions, $errors) && $role->setAdmin($admin)) {
             $db->CompleteTrans();
             sendTo('Roles', 'index', array('admin'));
         }
     }
     //	$db->FailTrans();
     //	$db->CompleteTrans();
     $this->refresh();
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:34,代码来源:RolesController.php

示例3: save

 public function save()
 {
     if (parent::save('EmployeeTrainingPlan')) {
         sendTo($this->name, 'index', $this->_modules);
     }
     $this->refresh();
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:7,代码来源:EmployeetrainingplansController.php

示例4: save

 public function save()
 {
     $flash = Flash::Instance();
     $errors = array();
     $partyaddress = $this->_uses[$this->modeltype];
     if (!empty($this->_data[$this->modeltype][$partyaddress->idField])) {
         // This is an update to an existing party address/address
         // so check if the address is used by other parties
         // - update it if address is only used by this party
         // - insert it if the current address is used by other parties and it does not already exist
         // - otherwise, no need to do anything here (but see below)
         if ($partyaddress->load($this->_data[$this->modeltype][$partyaddress->idField])) {
             $partyaddress->checkAddress($this->_data);
         } else {
             $errors[] = 'Error loading current Address details ' . $db->errorMsg();
         }
     }
     if (isset($this->_data['Address'])) {
         // Check if this address exists; if it does, point the PartyAddress to it
         // and remove the input address as it does not need inserting/updating
         $address = DataObjectFactory::Factory('Address');
         $address->check_exists($this->_data['Address']);
         if ($address->isLoaded()) {
             unset($this->_data['Address']);
             $this->_data[$this->modeltype]['address_id'] = $address->{$address->idField};
         }
     }
     if (count($errors) == 0 && parent::save($this->modeltype)) {
         sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
     } else {
         $flash->addErrors($errors);
         $this->refresh();
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:34,代码来源:PartyaddresssController.php

示例5: save

 public function save()
 {
     $flash = Flash::Instance();
     $errors = array();
     $data = $this->_data[$this->modeltype];
     $obj = '';
     if (!empty($data['task_id'])) {
         $obj = new Task();
         $obj->load($data['task_id']);
     } elseif (!empty($data['project_id'])) {
         $obj = new Project();
         $obj->load($data['project_id']);
     }
     if ($obj instanceof DataObject && $obj->isLoaded()) {
         if (fix_date($data['start_date']) < $obj->start_date) {
             $errors['start_date'] = 'Start date before ' . get_class($obj) . ' start date';
         }
         if (fix_date($data['end_date']) > $obj->end_date) {
             $errors['end_date'] = 'End date after ' . get_class($obj) . ' end date';
         }
     }
     if (!empty($data['person_id']) && $data['quantity'] > 1) {
         $errors['person_id'] = 'Quantity must be 1 for a person';
     }
     if (count($errors) == 0 && parent::save($this->modeltype, '', $errors)) {
         sendBack();
     } else {
         $flash->addErrors($errors);
         $this->refresh();
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:31,代码来源:ResourcesController.php

示例6: save

 public function save()
 {
     $flash = Flash::Instance();
     if (parent::save($this->modeltype)) {
         sendTo($this->name, 'index', $this->_modules);
     }
     $this->refresh();
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:8,代码来源:SupplementarycomplaintcodesController.php

示例7: save

 public function save()
 {
     $flash = Flash::Instance();
     if (parent::save('Address')) {
         sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
     }
     $this->refresh();
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:8,代码来源:AddresssController.php

示例8: save

 public function save()
 {
     $flash = Flash::Instance();
     if (parent::save('ComplaintVolume')) {
         sendTo($this->name, 'index', $this->_modules);
     }
     $this->refresh();
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:8,代码来源:ComplaintvolumesController.php

示例9: save

 public function save()
 {
     if (parent::save('ProjectIssueLine')) {
         sendTo('projectissues', 'view', array('projects'), array('id' => $this->saved_model->header_id));
     } else {
         $this->_new();
         $this->_templateName = $this->getTemplateName('new');
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:9,代码来源:ProjectissuelinesController.php

示例10: save

 public function save()
 {
     $flash = Flash::Instance();
     if (parent::save('Campaign')) {
         sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
     } else {
         $this->_new();
         $this->_templateName = $this->getTemplateName('new');
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:CampaignsController.php

示例11: save

 public function save()
 {
     $flash = Flash::Instance();
     if (parent::save('CompanyPermission')) {
         sendTo('CompanyPermissions', 'index', array('admin'));
     } else {
         $this->_new();
         $this->_templateName = $this->getTemplateName('new');
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:CompanypermissionsController.php

示例12: save

 public function save()
 {
     if (!$this->checkParams($this->modeltype)) {
         sendBack();
     }
     if (!parent::save($this->modeltype)) {
         $this->refresh();
     }
     sendTo($this->name, 'index', $this->_modules);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:SystempolicyaccesslistsController.php

示例13: save

 public function save()
 {
     $flash = Flash::Instance();
     if (parent::save('CalendarEventAttendee')) {
         sendBack();
     } else {
         $this->_new();
         $this->_templateName = $this->getTemplateName('new');
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:CalendareventattendeesController.php

示例14: save

 public function save()
 {
     $flash = Flash::Instance();
     //$this->_data['Holidayextraday']['authorisedby']=EGS_USERNAME;
     if (parent::save($this->modeltype)) {
         sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
     } else {
         $this->refresh();
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:HolidayextradaysController.php

示例15: save

 public function save()
 {
     $flash = Flash::Instance();
     if (parent::save('ProjectIssueHeader')) {
         sendTo('projectissues', 'view', array('projects'), array('id' => $this->saved_model->id));
     } else {
         $this->_new();
         $this->_templateName = $this->getTemplateName('new');
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:10,代码来源:ProjectissuesController.php


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