本文整理汇总了PHP中Debug::Arr方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::Arr方法的具体用法?PHP Debug::Arr怎么用?PHP Debug::Arr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::Arr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isUniqueUser
function isUniqueUser($id)
{
$ppslf = TTnew('PayPeriodScheduleListFactory');
$ph = array('id' => $id);
$query = 'select a.id from ' . $this->getTable() . ' as a, ' . $ppslf->getTable() . ' as b where a.pay_period_schedule_id = b.id AND a.user_id = ? AND b.deleted=0';
$user_id = $this->db->GetOne($query, $ph);
Debug::Arr($user_id, 'Unique User ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
if ($user_id === FALSE) {
return TRUE;
}
return FALSE;
}
示例2: isUniqueUser
function isUniqueUser($id)
{
$pclf = new PermissionControlListFactory();
$ph = array('id' => $id);
$query = 'select a.id from ' . $this->getTable() . ' as a, ' . $pclf->getTable() . ' as b where a.permission_control_id = b.id AND a.user_id = ? AND b.deleted=0';
$user_id = $this->db->GetOne($query, $ph);
Debug::Arr($user_id, 'Unique User ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
if ($user_id === FALSE) {
return TRUE;
}
return FALSE;
}
示例3: isUniqueName
function isUniqueName($name)
{
$ph = array('name' => $name);
$query = 'select id from ' . $this->getTable() . ' where name = ?';
$name_id = $this->db->GetOne($query, $ph);
Debug::Arr($name_id, 'Unique Name: ' . $name, __FILE__, __LINE__, __METHOD__, 10);
if ($name_id === FALSE) {
return TRUE;
} else {
if ($name_id == $this->getId()) {
return TRUE;
}
}
return FALSE;
}
示例4: isUnique
function isUnique($company_id, $id)
{
$ph = array('company_id' => (int) $company_id, 'id' => (int) $id);
$query = 'select id from ' . $this->getTable() . ' where company_id = ? AND id != ? AND deleted=0';
$id = $this->db->GetOne($query, $ph);
Debug::Arr($company_id, 'Company ID: ' . $company_id . ' ID: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
if ($id === FALSE) {
return TRUE;
} else {
if ($id == $this->getId()) {
return TRUE;
}
}
return FALSE;
}
示例5: isUniqueName
function isUniqueName($name)
{
$ph = array('company_id' => $this->getCompany(), 'name' => $name);
$query = 'select id from ' . $this->getTable() . ' where company_id = ? AND name = ? AND deleted = 0';
$hierarchy_control_id = $this->db->GetOne($query, $ph);
Debug::Arr($hierarchy_control_id, 'Unique Hierarchy Control ID: ' . $hierarchy_control_id, __FILE__, __LINE__, __METHOD__, 10);
if ($hierarchy_control_id === FALSE) {
return TRUE;
} else {
if ($hierarchy_control_id == $this->getId()) {
return TRUE;
}
}
return FALSE;
}
示例6: Done
function Done()
{
Debug::Arr($this->tmp_data, 'Pay Stub TMP Data: ', __FILE__, __LINE__, __METHOD__, 10);
//Call pre-save() first, so calculates the totals.
$this->setEnableCalcTotal(TRUE);
$this->preSave();
if ($this->Validate()) {
$this->CommitTransaction();
//$this->FailTransaction();
return TRUE;
}
$this->FailTransaction();
//Fails Transaction
$this->CommitTransaction();
//Rollback occurs here. This is important when looping over many employees that may have a pay stub that fails.
return FALSE;
}
示例7: smarty_function_EmbeddedAuthorizationList
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
function smarty_function_EmbeddedAuthorizationList($params, &$smarty)
{
global $current_company, $current_user;
$object_type_id = $params['object_type_id'];
$object_id = $params['object_id'];
$ulf = new UserListFactory();
$hlf = new HierarchyListFactory();
$hotlf = new HierarchyObjectTypeListFactory();
$alf = new AuthorizationListFactory();
$alf->setObjectType($object_type_id);
//$authorizing_obj = $alf->getObjectHandler()->getById( $object_id )->getCurrent();
$tmp_authorizing_obj = $alf->getObjectHandler()->getById($object_id);
if (is_object($tmp_authorizing_obj)) {
$authorizing_obj = $tmp_authorizing_obj->getCurrent();
} else {
return FALSE;
}
//var_dump($authorizing_obj);
unset($alf);
$user_id = $authorizing_obj->getUserObject()->getId();
$alf = new AuthorizationListFactory();
$alf->getByObjectTypeAndObjectId($object_type_id, $object_id);
foreach ($alf as $authorization_obj) {
$authorization_data[] = array('id' => $authorization_obj->getId(), 'created_by_full_name' => $ulf->getById($authorization_obj->getCreatedBy())->getCurrent()->getFullName(), 'authorized' => $authorization_obj->getAuthorized(), 'created_date' => $authorization_obj->getCreatedDate(), 'created_by' => $authorization_obj->getCreatedBy(), 'updated_date' => $authorization_obj->getUpdatedDate(), 'updated_by' => $authorization_obj->getUpdatedBy(), 'deleted_date' => $authorization_obj->getDeletedDate(), 'deleted_by' => $authorization_obj->getDeletedBy());
$user_id = $authorization_obj->getCreatedBy();
}
if ($authorizing_obj->getStatus() == 30) {
//If the object is still pending authorization, display who its waiting on...
$hierarchy_id = $hotlf->getByCompanyIdAndObjectTypeId($current_company->getId(), $object_type_id)->getCurrent()->getHierarchyControl();
Debug::Text('Hierarchy ID: ' . $hierarchy_id, __FILE__, __LINE__, __METHOD__, 10);
//Get Parents
$parent_level_user_ids = $hlf->getParentLevelIdArrayByHierarchyControlIdAndUserId($hierarchy_id, $user_id);
Debug::Arr($parent_level_user_ids, 'Parent Level Ids', __FILE__, __LINE__, __METHOD__, 10);
if ($parent_level_user_ids !== FALSE and count($parent_level_user_ids) > 0) {
Debug::Text('Adding Pending Line: ', __FILE__, __LINE__, __METHOD__, 10);
foreach ($parent_level_user_ids as $parent_user_id) {
$created_by_full_name[] = $ulf->getById($parent_user_id)->getCurrent()->getFullName();
}
$authorization_data[] = array('id' => NULL, 'created_by_full_name' => implode('<br>', $created_by_full_name), 'authorized' => NULL, 'created_date' => NULL, 'created_by' => NULL);
}
}
$smarty->assign_by_ref('authorization_data', $authorization_data);
$smarty->display('authorization/EmbeddedAuthorizationList.tpl');
}
示例8: Send
function Send()
{
Debug::Text('Attempting to send email To: ' . $this->getTo(), __FILE__, __LINE__, __METHOD__, 10);
if ($this->getTo() == FALSE) {
Debug::Text('To Address invalid...', __FILE__, __LINE__, __METHOD__, 10);
return FALSE;
}
if ($this->getBody() == FALSE) {
Debug::Text('Body invalid...', __FILE__, __LINE__, __METHOD__, 10);
return FALSE;
}
Debug::Text('Sending Email To: ' . $this->getTo() . ' Body Size: ' . strlen($this->getBody()) . ' Method: ' . $this->getDeliveryMethod(), __FILE__, __LINE__, __METHOD__, 10);
if (PRODUCTION == FALSE) {
Debug::Text('Not in production mode, not sending emails...', __FILE__, __LINE__, __METHOD__, 10);
//$to = 'root@localhost';
return FALSE;
}
if (DEMO_MODE == TRUE) {
Debug::Text('In DEMO mode, not sending emails...', __FILE__, __LINE__, __METHOD__, 10);
return FALSE;
}
switch ($this->getDeliveryMethod()) {
case 'smtp':
case 'mail':
$send_retval = $this->getMailObject()->send($this->getTo(), $this->getMIMEHeaders(), $this->getBody());
if (PEAR::isError($send_retval)) {
Debug::Text('Send Email Failed... Error: ' . $send_retval->getMessage(), __FILE__, __LINE__, __METHOD__, 10);
$send_retval = FALSE;
}
break;
case 'soap':
$ttsc = new TimeTrexSoapClient();
$send_retval = $ttsc->sendEmail($this->getTo(), $this->getMIMEHeaders(), $this->getBody());
break;
}
if ($send_retval == TRUE) {
return TRUE;
}
Debug::Arr($send_retval, 'Send Email Failed!', __FILE__, __LINE__, __METHOD__, 10);
return FALSE;
}
示例9: array
$pay_period_options = array();
}
if (isset($filter_data['start_date'])) {
$filter_data['start_date'] = TTDate::parseDateTime($filter_data['start_date']);
}
if (isset($filter_data['end_date'])) {
$filter_data['end_date'] = TTDate::parseDateTime($filter_data['end_date']);
}
$filter_data = Misc::preSetArrayValues($filter_data, array('include_user_ids', 'exclude_user_ids', 'user_status_ids', 'group_ids', 'branch_ids', 'department_ids', 'user_title_ids', 'pay_period_ids', 'column_ids'), array());
//Get Permission Hierarchy Children first, as this can be used for viewing, or editing.
$permission_children_ids = array();
$wage_permission_children_ids = array();
if ($permission->Check('punch', 'view') == FALSE) {
$hlf = TTnew('HierarchyListFactory');
$permission_children_ids = $wage_permission_children_ids = $hlf->getHierarchyChildrenByCompanyIdAndUserIdAndObjectTypeID($current_company->getId(), $current_user->getId());
Debug::Arr($permission_children_ids, 'Permission Children Ids:', __FILE__, __LINE__, __METHOD__, 10);
if ($permission->Check('punch', 'view_child') == FALSE) {
$permission_children_ids = array();
}
if ($permission->Check('punch', 'view_own')) {
$permission_children_ids[] = $current_user->getId();
}
$filter_data['permission_children_ids'] = $permission_children_ids;
}
//Get Wage Permission Hierarchy Children first, as this can be used for viewing, or editing.
if ($permission->Check('wage', 'view') == FALSE) {
if ($permission->Check('wage', 'view_child') == FALSE) {
$wage_permission_children_ids = array();
}
if ($permission->Check('wage', 'view_own')) {
$wage_permission_children_ids[] = $current_user->getId();
示例10: deleteUser
/**
* Delete one or more users.
* @param array $data user data
* @return array
*/
function deleteUser($data)
{
if (is_numeric($data)) {
$data = array($data);
}
if (DEMO_MODE == TRUE) {
return $this->returnHandler(TRUE);
}
if (!is_array($data)) {
return $this->returnHandler(FALSE);
}
if (!$this->getPermissionObject()->Check('user', 'enabled') or !($this->getPermissionObject()->Check('user', 'delete') or $this->getPermissionObject()->Check('user', 'delete_own') or $this->getPermissionObject()->Check('user', 'delete_child'))) {
return $this->getPermissionObject()->PermissionDenied();
}
//Get Permission Hierarchy Children first, as this can be used for viewing, or editing.
$permission_children_ids = $this->getPermissionChildren();
Debug::Text('Received data for: ' . count($data) . ' Users', __FILE__, __LINE__, __METHOD__, 10);
Debug::Arr($data, 'Data: ', __FILE__, __LINE__, __METHOD__, 10);
$total_records = count($data);
$validator_stats = array('total_records' => $total_records, 'valid_records' => 0);
if (is_array($data)) {
$this->getProgressBarObject()->start($this->getAMFMessageID(), $total_records);
foreach ($data as $key => $id) {
$primary_validator = new Validator();
$lf = TTnew('UserListFactory');
$lf->StartTransaction();
if (is_numeric($id)) {
if ($this->getPermissionObject()->Check('company', 'view') == TRUE) {
$lf->getById($id);
//Allow deleting employees in other companies.
} else {
$lf->getByIdAndCompanyId($id, $this->getCurrentCompanyObject()->getId());
}
if ($lf->getRecordCount() == 1) {
//Object exists, check edit permissions
//Debug::Text('User ID: '. $user['id'] .' Created By: '. $lf->getCurrent()->getCreatedBy() .' Is Owner: '. (int)$this->getPermissionObject()->isOwner( $lf->getCurrent()->getCreatedBy(), $lf->getCurrent()->getID() ) .' Is Child: '. (int)$this->getPermissionObject()->isChild( $lf->getCurrent()->getId(), $permission_children_ids ), __FILE__, __LINE__, __METHOD__, 10);
if ($this->getPermissionObject()->Check('user', 'delete') or $this->getPermissionObject()->Check('user', 'delete_own') and $this->getPermissionObject()->isOwner($lf->getCurrent()->getCreatedBy(), $lf->getCurrent()->getID()) === TRUE or $this->getPermissionObject()->Check('user', 'delete_child') and $this->getPermissionObject()->isChild($lf->getCurrent()->getId(), $permission_children_ids) === TRUE) {
Debug::Text('Record Exists, deleting record: ', $id, __FILE__, __LINE__, __METHOD__, 10);
$lf = $lf->getCurrent();
} else {
$primary_validator->isTrue('permission', FALSE, TTi18n::gettext('Delete permission denied'));
}
} else {
//Object doesn't exist.
$primary_validator->isTrue('id', FALSE, TTi18n::gettext('Delete permission denied, record does not exist'));
}
} else {
$primary_validator->isTrue('id', FALSE, TTi18n::gettext('Delete permission denied, record does not exist'));
}
//Debug::Arr($lf, 'AData: ', __FILE__, __LINE__, __METHOD__, 10);
$is_valid = $primary_validator->isValid();
if ($is_valid == TRUE) {
//Check to see if all permission checks passed before trying to save data.
Debug::Text('Attempting to delete record...', __FILE__, __LINE__, __METHOD__, 10);
$lf->setDeleted(TRUE);
$is_valid = $lf->isValid();
if ($is_valid == TRUE) {
Debug::Text('Record Deleted...', __FILE__, __LINE__, __METHOD__, 10);
$save_result[$key] = $lf->Save();
$validator_stats['valid_records']++;
}
}
if ($is_valid == FALSE) {
Debug::Text('Data is Invalid...', __FILE__, __LINE__, __METHOD__, 10);
$lf->FailTransaction();
//Just rollback this single record, continue on to the rest.
if ($primary_validator->isValid() == FALSE) {
$validator[$key] = $primary_validator->getErrorsArray();
} else {
$validator[$key] = $lf->Validator->getErrorsArray();
}
}
$lf->CommitTransaction();
$this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
}
$this->getProgressBarObject()->stop($this->getAMFMessageID());
if ($validator_stats['valid_records'] > 0 and $validator_stats['total_records'] == $validator_stats['valid_records']) {
if ($validator_stats['total_records'] == 1) {
return $this->returnHandler($save_result[$key]);
//Single valid record
} else {
return $this->returnHandler(TRUE, 'SUCCESS', TTi18n::getText('MULTIPLE RECORDS SAVED'), $save_result, $validator_stats);
//Multiple valid records
}
} else {
return $this->returnHandler(FALSE, 'VALIDATION', TTi18n::getText('INVALID DATA'), $validator, $validator_stats);
}
}
return $this->returnHandler(FALSE);
}
示例11: copyUserPreference
/**
* Copy one or more UserPreferencees.
* @param array $data UserPreference IDs
* @return array
*/
function copyUserPreference($data)
{
if (is_numeric($data)) {
$data = array($data);
}
if (!is_array($data)) {
return $this->returnHandler(FALSE);
}
Debug::Text('Received data for: ' . count($data) . ' UserPreferences', __FILE__, __LINE__, __METHOD__, 10);
Debug::Arr($data, 'Data: ', __FILE__, __LINE__, __METHOD__, 10);
$src_rows = $this->stripReturnHandler($this->getUserPreference(array('filter_data' => array('id' => $data)), TRUE));
if (is_array($src_rows) and count($src_rows) > 0) {
Debug::Arr($src_rows, 'SRC Rows: ', __FILE__, __LINE__, __METHOD__, 10);
foreach ($src_rows as $key => $row) {
unset($src_rows[$key]['id'], $src_rows[$key]['manual_id']);
//Clear fields that can't be copied
$src_rows[$key]['name'] = Misc::generateCopyName($row['name']);
//Generate unique name
}
//Debug::Arr($src_rows, 'bSRC Rows: ', __FILE__, __LINE__, __METHOD__, 10);
return $this->setUserPreference($src_rows);
//Save copied rows
}
return $this->returnHandler(FALSE);
}
示例12: extract
if (!$permission->Check('premium_policy', 'enabled') or !($permission->Check('premium_policy', 'view') or $permission->Check('premium_policy', 'view_own'))) {
$permission->Redirect(FALSE);
//Redirect
}
$smarty->assign('title', TTi18n::gettext($title = 'Premium Policy List'));
// See index.php
/*
* Get FORM variables
*/
extract(FormVariables::GetVariables(array('action', 'page', 'sort_column', 'sort_order', 'ids')));
URLBuilder::setURL($_SERVER['SCRIPT_NAME'], array('sort_column' => $sort_column, 'sort_order' => $sort_order, 'page' => $page));
$sort_array = NULL;
if ($sort_column != '') {
$sort_array = array($sort_column => $sort_order);
}
Debug::Arr($ids, 'Selected Objects', __FILE__, __LINE__, __METHOD__, 10);
$action = Misc::findSubmitButton();
switch ($action) {
case 'add':
Redirect::Page(URLBuilder::getURL(NULL, 'EditPremiumPolicy.php', FALSE));
break;
case 'delete':
case 'undelete':
if (strtolower($action) == 'delete') {
$delete = TRUE;
} else {
$delete = FALSE;
}
$pplf = TTnew('PremiumPolicyListFactory');
foreach ($ids as $id) {
$pplf->getByIdAndCompanyId($id, $current_company->getId());
示例13: copyRecurringPayStubAmendment
/**
* Copy one or more branches.
* @param array $data branch IDs
* @return array
*/
function copyRecurringPayStubAmendment($data)
{
if (is_numeric($data)) {
$data = array($data);
}
if (!is_array($data)) {
return $this->returnHandler(FALSE);
}
Debug::Text('Received data for: ' . count($data) . ' RecurringPayStubAmendments', __FILE__, __LINE__, __METHOD__, 10);
Debug::Arr($data, 'Data: ', __FILE__, __LINE__, __METHOD__, 10);
$src_rows = $this->stripReturnHandler($this->getRecurringPayStubAmendment(array('filter_data' => array('id' => $data)), TRUE));
if (is_array($src_rows) and count($src_rows) > 0) {
Debug::Arr($src_rows, 'SRC Rows: ', __FILE__, __LINE__, __METHOD__, 10);
foreach ($src_rows as $key => $row) {
unset($src_rows[$key]['id']);
//Clear fields that can't be copied
}
//Debug::Arr($src_rows, 'bSRC Rows: ', __FILE__, __LINE__, __METHOD__, 10);
return $this->setRecurringPayStubAmendment($src_rows);
//Save copied rows
}
return $this->returnHandler(FALSE);
}
示例14: runManualCommand
/**
* Run manual commands on timeclocks
* @param string $command command name
* @param array $data station IDs
* @return array
*/
function runManualCommand($command, $data)
{
if (is_numeric($data)) {
$data = array($data);
}
if (!is_array($data)) {
return $this->returnHandler(FALSE);
}
Debug::Text('Time Clock Command: ' . $command, __FILE__, __LINE__, __METHOD__, 10);
Debug::Text('Received data for: ' . count($data) . ' Stations', __FILE__, __LINE__, __METHOD__, 10);
Debug::Arr($data, 'Data: ', __FILE__, __LINE__, __METHOD__, 10);
$src_rows = $this->stripReturnHandler($this->getStation(array('filter_data' => array('id' => $data)), TRUE));
if (is_array($src_rows) and count($src_rows) > 0) {
Debug::Arr($src_rows, 'SRC Rows: ', __FILE__, __LINE__, __METHOD__, 10);
foreach ($src_rows as $key => $row) {
//Skip any non-timeclock types.
if ($row['type_id'] < 100) {
continue;
}
Debug::Text(' Type: ' . $row['type_id'] . ' Source: ' . $row['source'] . ' Port: ' . $row['port'] . ' Password: ' . $row['password'], __FILE__, __LINE__, __METHOD__, 10);
$tc = new TimeClock($row['type_id']);
$tc->setIPAddress($row['source']);
$tc->setPort($row['port']);
//$tc->setUsername( $row['user_name'] );
$tc->setPassword($row['password']);
$slf = TTnew('StationListFactory');
$slf->getByIdAndCompanyId($row['id'], $this->getCurrentCompanyObject()->getId());
if ($slf->getRecordCount() == 1) {
$s_obj = $slf->getCurrent();
}
$s_obj->setLastPunchTimeStamp($s_obj->getLastPunchTimeStamp());
if ($s_obj->getTimeZone() != '' and !is_numeric($s_obj->getTimeZone())) {
Debug::text('Setting Station TimeZone To: ' . $s_obj->getTimeZone(), __FILE__, __LINE__, __METHOD__, 10);
TTDate::setTimeZone($s_obj->getTimeZone());
}
$result_str = NULL;
switch ($command) {
case 'test_connection':
if ($tc->testConnection() == TRUE) {
$result_str = TTi18n::gettext('Connection Succeeded!');
} else {
$result_str = TTi18n::gettext('Connection Failed!');
}
break;
case 'set_date':
TTDate::setTimeZone($row['time_zone_id'], $s_obj->getTimeZone());
if ($tc->setDate(time()) == TRUE) {
$result_str = TTi18n::gettext('Date Successfully Set To: ') . TTDate::getDate('DATE+TIME', time());
} else {
$result_str = TTi18n::gettext('Setting Date Failed!');
}
break;
case 'download':
if (isset($s_obj) and $tc->Poll($this->getCurrentCompanyObject(), $s_obj) == TRUE) {
$result_str = TTi18n::gettext('Download Data Succeeded!');
if ($s_obj->isValid()) {
$s_obj->Save(FALSE);
}
} else {
$result_str = TTi18n::gettext('Download Data Failed!');
}
break;
case 'upload':
if (isset($s_obj) and $tc->Push($this->getCurrentCompanyObject(), $s_obj) == TRUE) {
$result_str = TTi18n::gettext('Upload Data Succeeded!');
if ($s_obj->isValid()) {
$s_obj->Save(FALSE);
}
} else {
$result_str = TTi18n::gettext('Upload Data Failed!');
}
break;
case 'update_config':
if (isset($s_obj) and $tc->setModeFlag($s_obj->getModeFlag()) == TRUE) {
$result_str = TTi18n::gettext('Update Configuration Succeeded');
} else {
$result_str = TTi18n::gettext('Update Configuration Failed');
}
break;
case 'delete_data':
if (isset($s_obj) and $tc->DeleteAllData($s_obj) == TRUE) {
$result_str = TTi18n::gettext('Delete Data Succeeded!');
if ($s_obj->isValid()) {
$s_obj->Save(FALSE);
}
} else {
$result_str = TTi18n::gettext('Delete Data Failed!');
}
break;
case 'reset_last_punch_time_stamp':
$s_obj->setLastPunchTimeStamp(time());
if ($s_obj->isValid()) {
$s_obj->Save(FALSE);
}
//.........这里部分代码省略.........
示例15: isValid
final function isValid($label = NULL)
{
if ($this->num_errors == 0) {
return TRUE;
} elseif ($label != NULL) {
//Debug::text('Num Errors: '. $this->num_errors, __FILE__, __LINE__, __METHOD__, $this->verbosity);
//Check to see if a single form variable is valid.
if (!isset($this->errors[$label])) {
return TRUE;
} else {
return FALSE;
}
}
Debug::Arr($this->errors, 'Errors', __FILE__, __LINE__, __METHOD__, $this->verbosity);
return FALSE;
}