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


PHP I2CE::raiseError方法代码示例

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


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

示例1: action_person_record_status

 public function action_person_record_status($obj)
 {
     if (!$obj instanceof iHRIS_PageView) {
         return;
     }
     $person = $obj->getPerson();
     if (!$person instanceof iHRIS_Person) {
         return false;
     }
     $obj->addChildForms('person_record_status');
     $template = $obj->getTemplate();
     $recordStatusObjs = $person->getChildren('person_record_status');
     if (count($recordStatusObjs) == 1) {
         return true;
     } else {
         if (count($recordStatusObjs) > 1) {
             I2CE::raiseError("Too many record status forms  for " . $person->getId());
             return false;
         } else {
             if ($obj->hasPermission("task(person_can_edit_child_form_person_record_status)")) {
                 $template->appendFileById("view_person_record_status_link.html", 'span', 'record_status_links');
             }
         }
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:26,代码来源:iHRIS_Module_RecordStatus.php

示例2: displayValues

 public function displayValues($content_node, $transient_options, $action)
 {
     if (!($mainNode = $this->template->appendFileByNode('swiss_form.html', 'div', $content_node)) instanceof DOMNode) {
         I2CE::raiseError("no template form_class_builder_menu.html");
         return false;
     }
     if (($classNode = $this->template->getElementByName('class', 0, $mainNode)) instanceof DOMNode) {
         $selected = $this->getField('class');
         foreach (I2CE::getConfig()->getKeys("/modules/forms/formClasses") as $class) {
             $attrs = array('value' => $class);
             if ($selected == $class) {
                 $attrs['selected'] = $selected;
             }
             $classNode->appendChild($this->template->createElement('option', $attrs, $class));
         }
     }
     $this->template->setDisplayDataImmediate('display', $this->getField('display'), $mainNode);
     $storage = $this->getField('storage');
     if (!$storage) {
         $storage = 'entry';
     }
     $this->template->setDisplayDataImmediate('storage', $storage, $mainNode);
     $this->renameInputs(array('display', 'class'), $mainNode);
     if (($metaChild = $this->getChild('meta', true)) instanceof I2CE_Swiss && ($metaNode = $this->template->getElementById('meta', $mainNode)) instanceof DOMNode) {
         $metaChild->addAjaxLink('meta_link', 'container', 'meta_ajax', $metaNode, $action, $transient_options);
     }
     if (($storage_optionsChild = $this->getChild('storage_options', true)) instanceof I2CE_Swiss && ($storage_optionsNode = $this->template->getElementById('storage_options', $mainNode)) instanceof DOMNode) {
         $storage_optionsChild->addAjaxLink('storage_options_link', 'container', 'storage_options_ajax', $storage_optionsNode, $action, $transient_options);
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:31,代码来源:I2CE_Swiss_Form.php

示例3: loadObjects

 protected function loadObjects()
 {
     $factory = I2CE_FormFactory::instance();
     if ($this->isPost()) {
         $dataset = $factory->createContainer('dataset');
         if (!$dataset instanceof iHRIS_DataSet) {
             I2CE::raiseError("Could not create Data Set form");
             return;
         }
         $dataset->load($this->post);
         //$surname_ignore = $person->getField('surname_ignore');
         //$ignore_path = array('forms','person',$person->getID(),'ignore','surname');
         //            if ($surname_ignore instanceof I2CE_FormField && $this->post_exists($ignore_path)) {
         //                $surname_ignore->setFromPost($this->post($ignore_path));
         //            }
     } else {
         if ($this->get_exists('id')) {
             $id = $this->get('id');
             if (strpos($id, '|') === false) {
                 I2CE::raiseError("Depcreated use of id variable");
                 $id = 'dataset|' . $id;
             }
         } else {
             $id = 'dataset|0';
         }
         $dataset = $factory->createContainer($id);
         if (!$dataset instanceof iHRIS_DataSet) {
             I2CE::raiseError("Could not create valid Data Set form from id:{$id}");
             return;
         }
         $dataset->populate();
         $dataset->load($this->request());
     }
     $this->setObject($dataset);
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:35,代码来源:iHRIS_PageFormDataSet.php

示例4: displayValues

 public function displayValues($content_node, $transient_options, $action)
 {
     if (!($mainNode = $this->template->appendFileByNode('swiss_form_meta.html', 'div', $content_node)) instanceof DOMNode) {
         I2CE::raiseError("no template ");
         return false;
     }
     $inputs = array('description');
     $forms = I2CE::getConfig()->getKeys("/modules/forms/forms");
     $selected = $this->getSelectedForms();
     if (!is_array($selected)) {
         //in case it wan't ever set
         $selected = array();
     }
     if (($formsNode = $this->template->getElementByName('child_forms', 0, $mainNode)) instanceof DOMNode) {
         foreach ($forms as $form) {
             $input = 'child_forms[' . $form . ']';
             $inputs[] = $input;
             $attr = array('value' => 1, 'name' => $input, 'type' => 'checkbox');
             if (in_array($form, $selected)) {
                 $attr['checked'] = 'checked';
             }
             $formsNode->appendChild($formNode = $this->template->createElement('span', array('style' => 'display:inline-block;width:33%; min-width:33%')));
             $formNode->appendChild($this->template->createElement('input', $attr));
             $formNode->appendChild($this->template->createTextNode($form));
         }
     }
     $this->template->setDisplayDataImmediate('description', $this->getField('description'), $mainNode);
     $this->renameInputs($inputs, $mainNode);
     if (($swissChild = $this->getChild('child_form_data', true)) instanceof I2CE_Swiss && ($childNode = $this->template->getElementById('child_form_data', $mainNode)) instanceof DOMNode) {
         $swissChild->addAjaxLink('child_form_data_link', 'display_container', 'child_form_data_ajax', $childNode, $action, $transient_options);
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:33,代码来源:I2CE_Swiss_Form_meta.php

示例5: processResultRow

 /**
  * Process a result row.
  * @param array $row
  * @param int $row_num The current row number when processing results.  If there was a result limit, it starts the count from the beginning of the
  * result offset.  Othwerwise, it starts counting form zero.
  * @param DOMNode $contentNode. Default to null. A node to append the result onto
  */
 protected function processResultRow($row, $row_num, $contentNode = null)
 {
     parent::processResultRow($row, $row_num, $contentNode);
     $per_page = (int) $this->defaultOptions['limit_per_page'];
     if ($per_page < 1) {
         //check it is not bad, if so make it something reasonable -- in fact make it the default per page in I2CE_CustomReport_Display
         $per_page = 100;
     }
     $page = (int) $this->defaultOptions['limit_page'];
     //$page = (int) $this->page->request('limit_page');
     if ($page < 1) {
         $page = 1;
     }
     $appendCount = $row_num - ($page - 1) * $per_page;
     $cellNode = $this->template->appendFileByName("customReports_table_data_cell.html", "td", "report_row", $appendCount, null, true);
     if (!$cellNode instanceof DOMNode) {
         I2CE::raiseError("Could not add data cell to table");
         return false;
     }
     $field_args = array();
     foreach ($this->page->getActionFields() as $field) {
         $field_args[] = $row->{$field};
     }
     $actionNode = $this->page->getActionNode($field_args);
     $this->template->appendNode($actionNode, $cellNode);
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:34,代码来源:I2CE_CustomReport_Display_DefaultAction.php

示例6: processValues

 /**
  * Update config for given values
  * @param array $vals.  An array of values (presumably from $_POST) to update magic data from
  * @returns  true on sucess
  */
 public function processValues($vals)
 {
     //add a new field name,formfield,header
     foreach (array('name', 'formfield', 'header') as $key) {
         if (!array_key_exists($key, $vals) || !is_scalar(${$key} = $vals[$key]) || !${$key}) {
             I2CE::raiseError("Missing {$key} when creating a new field");
             return false;
         }
     }
     if (!I2CE_MagicDataNode::checkKey($name) || in_array($name, $this->getFieldNames(true))) {
         I2CE::raiseError("Could not create a new field named  {$name}");
         return false;
     }
     $formfields = I2CE::getConfig()->getKeys("/modules/forms/FORMFIELD");
     if (!in_array($formfield, $formfields)) {
         I2CE::raiseError("Invalid form field");
         return false;
     }
     $this->storage->{$name} = array('formfield' => $formfield);
     if (!($swissField = $this->getChild($name)) instanceof I2CE_Swiss_FormField) {
         I2CE::raiseError("Could not get field controler");
         return false;
     }
     if (!($swissHeaders = $swissField->getChild('headers', true)) instanceof I2CE_Swiss_FormField_Headers) {
         I2CE::raiseError("Could not get headers controler");
         return false;
     }
     $swissHeaders->processValues(array('val' => array('default' => $header)));
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:35,代码来源:I2CE_Swiss_FormClass_Fields.php

示例7: displayValues

 public function displayValues($contentNode, $transient_options, $action)
 {
     $mainNode = $this->template->appendFileByNode('view_relationship_forms.html', 'div', $contentNode);
     if (!$mainNode instanceof DOMNode) {
         I2CE::raiseError("Unable to add reported form list template");
         return false;
     }
     $listNode = $this->template->getElementById('report_forms_list', $mainNode);
     if (!$listNode instanceof DOMElement) {
         I2CE::raiseError("Don't knwo where to add forms");
         return false;
     }
     $swissRelationshipForms = $this->getSwissFormsInRelationship();
     foreach ($swissRelationshipForms as $form => $swissRelationshipForm) {
         if ($swissRelationshipForm instanceof I2CE_Swiss_FormRelationship_Join) {
             $swissForm = $this->getChild($form, true);
         } else {
             $swissForm = $this->getChild('primary_form', true);
         }
         if (!$swissForm instanceof I2CE_Swiss_CustomReports_Report_ReportingForm) {
             continue;
         }
         $formNode = $this->template->appendFileByNode('customReports_report_forms_each.html', 'li', $listNode);
         if (!$formNode instanceof DOMNode) {
             continue;
         }
         $this->template->setDisplayDataImmediate('name', $form, $formNode);
         $swissForm->addAjaxLink('form_link', 'form_contents', 'form_ajax', $formNode, $action, $transient_options);
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:31,代码来源:I2CE_Swiss_ViewRelationship_Forms.php

示例8: displayValues

 public function displayValues($content_node, $transient_options, $action)
 {
     if (!($mainNode = $this->template->appendFileByNode('swiss_xmlrelationship_formfields.html', 'div', $content_node)) instanceof DOMNode) {
         return false;
     }
     $listNode = $this->template->getElementById('forms_list', $mainNode);
     if (!$listNode instanceof DOMElement) {
         I2CE::raiseError("Don't know where to add forms");
         return false;
     }
     foreach ($this->getFormNames() as $formname) {
         if (!($swissChild = $this->getChild($formname, true)) instanceof I2CE_Swiss) {
             continue;
         }
         $formNode = $this->template->appendFileByNode('swiss_xmlrelationship_formfields_each.html', 'li', $listNode);
         if (!$formNode instanceof DOMNode) {
             continue;
         }
         $name = $formname;
         if ($formname == 'primary_form' && ($relObj = $this->getRelationship()) instanceof I2CE_FormRelationship) {
             $name = $relObj->getForm('primary_form') . ' (primary_form)';
         }
         $this->template->setDisplayDataImmediate('name', $name, $formNode);
         $swissChild->addAjaxLink('form_link', 'form_contents', 'form_ajax', $formNode, $action, $transient_options);
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:27,代码来源:I2CE_Swiss_PageXMLRelationship_FormFields.php

示例9: action

 public function action()
 {
     parent::action();
     $init_options = array('root_path' => '/modules/forms/storage_options/CSD/remote_services', 'root_path_create' => true, 'root_url' => 'remote_directory_selector', 'root_type' => 'ServiceDirectorySelector');
     try {
         $swiss_factory = new I2CE_SwissMagicFactory($this, $init_options);
     } catch (Exception $e) {
         I2CE::raiseError("Could not create swissmagic for selectable" . $e->getMessage());
         return false;
     }
     try {
         $swiss_factory->setRootSwiss();
     } catch (Exception $e) {
         I2CE::raiseError("Could not create root swissmagic for selectable" . $e->getMessage());
         return false;
     }
     $swiss_path = $this->request_remainder;
     $action = array_shift($swiss_path);
     if ($action == 'update' && $this->isPost()) {
         if ($swiss_factory->updateValues($this->post())) {
             $this->userMessage("Updated Remote Directories");
         } else {
             $this->userMessage("Unable To Update Remote Directories");
         }
         $this->setRedirect('home');
     }
     $action = 'edit';
     return $swiss_factory->displayValues($this->template->getElementById('siteContent'), $swiss_path, $action);
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:29,代码来源:I2CE_Page_SelectServiceDirectory.php

示例10: ensureFieldsFromForm

 protected function ensureFieldsFromForm()
 {
     if ($this->ensured) {
         return;
     }
     $swissForm = $this->getAncestorByClass('I2CE_Swiss_CustomReports_Report_ReportingForm');
     if (!$swissForm instanceof I2CE_Swiss_CustomReports_Report_ReportingForm) {
         I2CE::raiseError("Could not get reported form");
         return;
     }
     $formRel = $this->getSwissRelationshipForm($swissForm->storage->getName());
     if (!$formRel instanceof I2CE_Swiss) {
         I2CE::raiseError("Could not get relationship form for " . $swissForm->storage->getName());
         return;
     }
     $formName = $formRel->getField("form");
     if (!$formName) {
         I2CE::raiseError("Could not get relationship form name for " . $swissForm->storage->getName());
         return;
     }
     $factory = I2CE_FormFactory::instance();
     $fields = $factory->getFieldNames($formName, array('in_db' => true));
     $fields[] = 'last_modified';
     $fields[] = 'created';
     foreach ($fields as $field) {
         $this->getChild($field, true);
     }
     $this->getChild('id', true);
     $this->ensured = true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:30,代码来源:I2CE_Swiss_CustomReports_Report_ReportingForm_Fields.php

示例11: actionReport

 /**
  * Create the report display and add it to the page.
  * @param string $query The query string to pass to the action for applying limits.
  * @return boolean
  */
 protected function actionReport($query = '')
 {
     try {
         $this->display = new I2CE_CustomReport_Display_DefaultAction($this, $this->args['report_view']);
     } catch (Exception $e) {
         I2CE::raiseError("Could not get for " . $this->args['report_view'] . "\n" . $e);
         return false;
     }
     $this->template->addHeaderLink($this->args['action_script']);
     $this->template->addHeaderLink("CustomReports.css");
     $this->template->addHeaderLink("CustomReports_iehacks.css", array('ie6' => true));
     $this->template->setDisplayData("limit_description", false);
     $contentNode = $this->template->getElementById("siteContent");
     if (!$contentNode instanceof DOMNode || !$this->display->display($contentNode)) {
         I2CE::raiseError("Couldn't display report.  Either no content node or an error occurred displaying the report.");
         return false;
     }
     $reportLimitsNode = $this->template->getElementById('report_limits');
     if (!$reportLimitsNode instanceof DOMNode) {
         I2CE::raiseError("Unable to find report_limits node.");
     } else {
         $applyNode = $this->template->appendFileByNode("customReports_display_limit_apply_Default.html", "tr", $reportLimitsNode);
         $form = $this->template->query(".//*[@id='limit_form']", $contentNode);
         if ($form->length == 1) {
             $form = $form->item(0)->setAttribute('action', $this->page() . "?{$query}");
         }
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:34,代码来源:I2CE_PageReportAction.php

示例12: displayMeta

 protected function displayMeta($mainNode, $transient_options, $action)
 {
     foreach (self::$bool_keys as $k => $default) {
         if ($this->hasField($k)) {
             $val = $this->getField($k) ? 1 : 0;
         } else {
             $val = $default;
         }
         $this->template->selectOptionsImmediate($k, array($val), $mainNode);
     }
     $this->renameInputs(array_keys(self::$bool_keys), $mainNode);
     if (!($sortNode = $this->template->getElementByName('key_sort', 0, $mainNode)) instanceof DOMNode) {
         I2CE::raiseError("Don't know where to add key sorts");
         return false;
     }
     $sort = $this->getField('key_sort');
     if (!in_array($sort, self::$allowed_sorts)) {
         $sort = 'SORT_NATURAL_CASE';
         //the default
     }
     foreach (self::$allowed_sorts as $s) {
         $attrs = array('value' => $s);
         if ($sort == $s) {
             $attrs['selected'] = 'selected';
         }
         $sortNode->appendChild($this->template->createElement('option', $attrs, $s));
     }
     $this->renameInputs(array('key_sort'), $mainNode);
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:30,代码来源:I2CE_Swiss_ASSOC_LIST_meta.php

示例13: ensureFunctions

 protected function ensureFunctions()
 {
     if ($this->ensured) {
         return true;
     }
     $swissRel = $this->getSwissRelationship();
     if (!$swissRel instanceof I2CE_Swiss_FormRelationship) {
         I2CE::raiseError("Could not get Relationship");
         return false;
     }
     $relFunctions = $swissRel->getSwissFunctions();
     if (!$relFunctions instanceof I2CE_Swiss_FormRelationship_ReportingFunctions) {
         return false;
     }
     $rels = array($relFunctions);
     while (count($rels) > 0) {
         $relFunctions = array_pop($rels);
         foreach ($relFunctions as $func => $swissRelFunction) {
             $this->getChild($func, true);
             if (($t_relFunctions = $swissRelFunction->getChild('reporting_functions')) instanceof I2CE_Swiss_FormRelationship_ReportingFunctions) {
                 $rels[] = $t_relFunctions;
             }
         }
     }
     $this->ensured = true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:26,代码来源:I2CE_Swiss_CustomReports_Report_ReportingFunctions.php

示例14: displayValues

 public function displayValues($content_node, $transient_options, $action)
 {
     if (!($mainNode = $this->template->appendFileByNode('swiss_mapped_limits_form.html', 'div', $content_node)) instanceof DOMNode || !($limitsNode = $this->template->getElementByName('limits', 0, $mainNode))) {
         I2CE::raiseError("Could not load swiss_mapped_limits.html");
         return false;
     }
     $existing = $this->storage->getKeys();
     if (($selectNode = $this->template->getElementByName('new', 0, $mainNode)) instanceof DOMNode) {
         foreach (I2CE::getConfig()->getKeys("/modules/forms/forms") as $key) {
             if (in_array($key, $existing)) {
                 continue;
             }
             $selectNode->appendChild($this->template->createElement('option', array('value' => $key), $key));
         }
     }
     $this->renameInputs(array('new'), $mainNode);
     foreach ($existing as $name) {
         $limitsNode->appendChild($liNode = $this->template->createElement('li'));
         if (!($limitNode = $this->template->appendFileByNode('swiss_mapped_limits_each.html', 'div', $liNode)) instanceof DOMNode || !($swissLimit = $this->getChild($name)) instanceof I2CE_Swiss) {
             continue;
         }
         $this->template->setDisplayDataImmediate('name', $name, $limitNode);
         $swissLimit->addAjaxLink('limit_link', 'relationship_where_container', 'limit_ajax', $limitNode, $action, $transient_options);
         $delete_link = $swissLimit->getURLRoot('delete_class') . $swissLimit->path;
         $this->template->setDisplayDataImmediate('delete_link', $delete_link, $limitNode);
     }
     return true;
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:28,代码来源:I2CE_Swiss_MAPPED_limits_form.php

示例15: generateUUID

 /**
  * Wrapper function to fenerates a UUID via the pecl uuid module.
  * More {@link http://pwet.fr/man/linux/fonctions_bibliotheques/ossp/uuid doucmentation} on ossp uuid.
  *
  * <br/>
  * Version 1 UUIDs are guaranteed to be unique through combinations of hardware addresses, time stamps and random seeds. There is a reference in the UUID to the hardware (MAC) address of the first network interface card (NIC) on the host which generated the UUID this reference is intended to ensure the UUID will be unique in space as the MAC address of every network card is assigned by a single global authority (IEEE) and is guaranteed to be unique. The next component in a UUID is a timestamp which, as clock always (should) move forward, will be unique in time. Just in case some part of the above goes wrong (the hardware address cannot be determined or the clock moved steps backward), there is a random clock sequence component placed into the UUID as a catch-all for uniqueness.
  * <br/>
  * Version 3 and version 5 UUIDs are guaranteed to be inherently globally unique if the combination of namespace and name used to generate them is unique.  It is  not supported at the moment
  * <br/>
  * Version 4 UUIDs are not guaranteed to be globally unique, because they are generated out of locally gathered pseudo-random numbers only. Nevertheless there is still a high likelihood of uniqueness over space and time and that they are computationally difficult to guess. 
  *                                                                                                *
  * http://manpages.ubuntu.com/manpages/dapper/man3/uuid.3ossp.html
  * V1 -- Time an node
  * V4 -- random data
  * 
  * @param string $version.  Defaults to 1
  * @retruns mixed string or false on failure
  */
 public static function generateUUID($version = 4)
 {
     switch ($version) {
         case 3:
             I2CE::raiseError("Version 3 not supported");
             return false;
             break;
         case 5:
             I2CE::raiseError("Version 5 not supported");
             return false;
             break;
         case 4:
             $version = UUID_TYPE_RANDOM;
             break;
         default:
         case 1:
             $version = UUID_TYPE_DEFAULT;
             break;
     }
     // if (  0 != uuid_make ( self::$uuidobject, $version ) > 0 ) { //i think it returns a non-zero on failure
     //     return false;
     // }
     // uuid_export ( self::$uuidobject, UUID_FMT_STR, &$uuidstring );
     return trim(uuid_create($version));
 }
开发者ID:apelon-ohie,项目名称:ihris-site,代码行数:43,代码来源:iHRIS_UUID_Map_pecl.php


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