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


PHP DCL_Sanitize::ToYN方法代码示例

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


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

示例1: show

 function show($orderBy = 'short')
 {
     global $dcl_info, $g_oSec;
     if (!$g_oSec->HasPerm(DCL_ENTITY_CONTACT, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     commonHeader();
     $oView = CreateObject('dcl.boView');
     $oView->startrow = 0;
     $oView->numrows = 25;
     $filterActive = '';
     if (isset($_REQUEST['filterActive'])) {
         $filterActive = DCL_Sanitize::ToYN($_REQUEST['filterActive']);
     }
     $oView->table = 'dcl_contact';
     $oView->title = 'Browse Contacts';
     $oView->AddDef('columnhdrs', '', array('ID', 'Last Name', 'First Name', 'Phone', 'Email', 'Internet'));
     $oView->AddDef('columns', '', array('contact_id', 'last_name', 'first_name', 'dcl_contact_phone.phone_number', 'dcl_contact_email.email_addr', 'dcl_contact_url.url_addr'));
     $oView->AddDef('order', '', array('last_name', 'first_name'));
     if ($filterActive == 'Y' || $filterActive == 'N') {
         $oView->AddDef('filter', 'active', "'{$filterActive}'");
     }
     $oHtml = CreateObject('dcl.htmlContactBrowse');
     $oHtml->Render($oView);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:25,代码来源:class.htmlContact.inc.php

示例2: submitModify

 function submitModify()
 {
     global $g_oSession, $dcl_info, $g_oSec;
     if (!$g_oSec->HasPerm(DCL_ENTITY_PREFS, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     $bHasChanges = false;
     $o = CreateObject('dcl.dbPreferences');
     $o->personnel_id = $GLOBALS['DCLID'];
     $o->preferences_data = $g_oSession->Value('dcl_preferences');
     if (!isset($o->preferences_data) || !is_array($o->preferences_data) || count($o->preferences_data) < 1) {
         $o->preferences_data = array('DCL_PREF_TEMPLATE_SET' => $dcl_info['DCL_DEF_TEMPLATE_SET'], 'DCL_PREF_LANGUAGE' => $dcl_info['DCL_DEFAULT_LANGUAGE'], 'DCL_PREF_NOTIFY_DEFAULT' => 'N', 'DCL_PREF_CREATED_WATCH_OPTION' => 4);
         $o->Add();
         $bHasChanges = true;
     }
     $sOldTpl = $o->preferences_data['DCL_PREF_TEMPLATE_SET'];
     foreach ($_REQUEST as $pref => $setting) {
         if (substr($pref, 0, 9) != 'DCL_PREF_') {
             continue;
         }
         if ($pref == 'DCL_PREF_NOTIFY_DEFAULT') {
             $setting = DCL_Sanitize::ToYN($_REQUEST['DCL_PREF_NOTIFY_DEFAULT']);
         }
         if ($o->Value($pref) != $setting) {
             $bHasChanges = true;
             $o->Register($pref, $setting);
         }
     }
     if (!isset($_REQUEST['DCL_PREF_NOTIFY_DEFAULT'])) {
         $bHasChanges = true;
         $o->Register('DCL_PREF_NOTIFY_DEFAULT', 'N');
     }
     if ($bHasChanges) {
         $o->Edit();
         $g_oSession->Register('dcl_preferences', $o->preferences_data);
         $g_oSession->Edit();
     }
     // Template change?
     $sNewTpl = $o->preferences_data['DCL_PREF_TEMPLATE_SET'];
     if ($sNewTpl != $sOldTpl) {
         // Do we need to break out of frames?
         $menuAction = 'menuAction=htmlPreferences.modify';
         $sNewIsFramed = file_exists(DCL_ROOT . 'templates/' . $sNewTpl . '/frameset.php');
         $sOldIsFramed = file_exists(DCL_ROOT . 'templates/' . $sOldTpl . '/frameset.php');
         if ($sOldIsFramed) {
             if ($sNewIsFramed) {
                 RefreshTop(menuLink(DCL_WWW_ROOT . 'templates/' . $sNewTpl . '/frameset.php', $menuAction));
             } else {
                 RefreshTop(menuLink('', $menuAction));
             }
         } else {
             if ($sNewIsFramed) {
                 RefreshTop(menuLink(DCL_WWW_ROOT . 'templates/' . $sNewTpl . '/frameset.php', $menuAction));
             }
         }
     }
     $this->modify();
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:58,代码来源:class.htmlPreferences.inc.php

示例3: modify

 function modify($aSource)
 {
     $aSource['active'] = @DCL_Sanitize::ToYN($aSource['active']);
     parent::modify($aSource);
     $oWSP = CreateObject('dcl.dbWorkspaceProduct');
     $oWSP->serialize($aSource['workspace_id'], $aSource['products'], false);
     $oWSU = CreateObject('dcl.dbWorkspaceUser');
     $oWSU->serialize($this->oDB->workspace_id, $aSource['users'], false);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:9,代码来源:class.boWorkspace.inc.php

示例4: dbmodify

 function dbmodify()
 {
     global $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_FAQ, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     $obj =& CreateObject('dcl.dbFaq');
     $obj->InitFromGlobals();
     $obj->active = @DCL_Sanitize::ToYN($_REQUEST['active']);
     $obj->modifyby = $GLOBALS['DCLID'];
     $obj->modifyon = DCL_NOW;
     $obj->Edit();
     $objH =& CreateObject('dcl.htmlFaq');
     $objH->ShowFaq($obj);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:16,代码来源:class.boFaq.inc.php

示例5: modify

 function modify($aSource)
 {
     global $g_oSec;
     if (!$g_oSec->HasPerm(DCL_ENTITY_CONTACT, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     $aSource['active'] = @DCL_Sanitize::ToYN($aSource['active']);
     parent::modify($aSource);
     $sTypes = join(',', $aSource['contact_type_id']);
     $sql = 'DELETE FROM dcl_contact_type_xref WHERE contact_id = ' . $aSource['contact_id'];
     if (count($aSource['contact_type_id']) > 0) {
         $sql .= ' AND contact_type_id NOT IN (' . $sTypes . ')';
     }
     $this->oDB->Execute($sql);
     $oContactTypeXref =& CreateObject('dcl.boContactTypeXref');
     foreach ($aSource['contact_type_id'] as $contact_type_id) {
         if (!$oContactTypeXref->exists(array('contact_id' => $aSource['contact_id'], 'contact_type_id' => $contact_type_id))) {
             $oContactTypeXref->Add(array('contact_id' => $aSource['contact_id'], 'contact_type_id' => $contact_type_id));
         }
     }
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:21,代码来源:class.boContact.inc.php

示例6: submitToggle

 function submitToggle()
 {
     global $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_WORKORDER, DCL_PERM_ACTION)) {
         return PrintPermissionDenied();
     }
     if (($wo_task_id = DCL_Sanitize::ToInt($_REQUEST['wo_task_id'])) === null) {
         trigger_error('Data sanitize failed.');
         return;
     }
     $task_complete = @DCL_Sanitize::ToYN($_REQUEST['task_complete']);
     $obj = CreateObject('dcl.boWorkOrderTask');
     $aSource = array('wo_task_id' => $wo_task_id, 'task_complete' => $task_complete);
     $obj->toggleComplete($aSource);
     $objWO =& CreateObject('dcl.htmlWorkOrderDetail');
     $objWO->Show($obj->oDB->wo_id, $obj->oDB->seq);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:18,代码来源:class.htmlWorkOrderTask.inc.php

示例7: modify

 function modify($aSource)
 {
     $aSource['active'] = @DCL_Sanitize::ToYN($aSource['active']);
     parent::modify($aSource);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:5,代码来源:class.boHotlist.inc.php

示例8: dbsearch

 function dbsearch()
 {
     commonHeader();
     $personnel = isset($_REQUEST['personnel']) && is_array($_REQUEST['personnel']) ? $_REQUEST['personnel'] : array();
     $type = @DCL_Sanitize::ToIntArray($_REQUEST['type']);
     $priority = @DCL_Sanitize::ToIntArray($_REQUEST['priority']);
     $status = @$_REQUEST['status'];
     $account = @DCL_Sanitize::ToIntArray($_REQUEST['account']);
     $is_public = @$_REQUEST['is_public'];
     $entity_source_id = @DCL_Sanitize::ToIntArray($_REQUEST['entity_source_id']);
     $createdon = @$_REQUEST['createdon'];
     $closedon = @$_REQUEST['closedon'];
     $statuson = @$_REQUEST['statuson'];
     $lastactionon = @$_REQUEST['lastactionon'];
     $module_id = isset($_REQUEST['module_id']) && is_array($_REQUEST['module_id']) ? $_REQUEST['module_id'] : array();
     $tags = $_REQUEST['tags'];
     $searchText = $_REQUEST['searchText'];
     $columns = $_REQUEST['columns'];
     $groups = $_REQUEST['groups'];
     $order = $_REQUEST['order'];
     $columnhdrs = $_REQUEST['columnhdrs'];
     $dcl_status_type = @DCL_Sanitize::ToIntArray($_REQUEST['dcl_status_type']);
     $product = @DCL_Sanitize::ToIntArray($_REQUEST['product']);
     $department = @DCL_Sanitize::ToIntArray($_REQUEST['department']);
     $dateFrom = DCL_Sanitize::ToDate($_REQUEST['dateFrom']);
     $dateTo = DCL_Sanitize::ToDate($_REQUEST['dateTo']);
     $oDB = new dclDB();
     if (strlen($columnhdrs) > 0) {
         $columnhdrs = explode(',', $columnhdrs);
     } else {
         $columnhdrs = array();
     }
     if (strlen($columns) > 0) {
         $columns = explode(',', $columns);
     } else {
         $columns = array();
     }
     if (strlen($groups) > 0) {
         $groups = explode(',', $groups);
     } else {
         $groups = array();
     }
     if (strlen($order) > 0) {
         $order = explode(',', $order);
     } else {
         $order = array();
     }
     $objView =& CreateObject('dcl.boView');
     $objView->table = 'tickets';
     if (count($personnel) > 0 || count($department) > 0) {
         $fieldList = array('responsible', 'createdby', 'closedby');
         $bStrippedDepartments = false;
         $pers_sel = array();
         foreach ($fieldList as $field) {
             if (!isset($_REQUEST[$field]) || $_REQUEST[$field] != '1') {
                 continue;
             }
             if (count($personnel) > 0) {
                 if (!$bStrippedDepartments) {
                     $bStrippedDepartments = true;
                     // Have actual personnel?  If so, only set personnel for their associated departments instead of the department
                     // then unset the department from the array
                     foreach ($personnel as $encoded_pers) {
                         list($dpt_id, $pers_id) = explode(',', $encoded_pers);
                         $pers_sel[count($pers_sel)] = $pers_id;
                         if (count($department) > 0 && in_array($dpt_id, $department)) {
                             foreach ($department as $key => $department_id) {
                                 if ($department_id == $dpt_id) {
                                     unset($department[$key]);
                                     break;
                                 }
                             }
                         }
                     }
                 }
                 $pers_sel = DCL_Sanitize::ToIntArray($pers_sel);
                 if (count($pers_sel) > 0) {
                     $objView->AddDef('filter', $field, $pers_sel);
                 }
             }
             if (count($department) > 0) {
                 $objView->AddDef('filter', $field . '.department', $department);
             }
         }
     }
     $fieldList = array('priority', 'type', 'account', 'entity_source_id');
     while (list($key, $field) = each($fieldList)) {
         ${$field} = DCL_Sanitize::ToIntArray(${$field});
         if (count(${$field}) > 0) {
             $objView->AddDef('filter', $field, ${$field});
         }
     }
     if (trim($tags) != '') {
         $objView->AddDef('filter', 'dcl_tag.tag_desc', $tags);
     }
     if (count($is_public) > 0) {
         foreach ($is_public as $publicValue) {
             $objView->AddDef('filter', 'is_public', $oDB->Quote(DCL_Sanitize::ToYN($publicValue)));
         }
     }
//.........这里部分代码省略.........
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:101,代码来源:class.boTickets.inc.php

示例9: show

 function show()
 {
     global $dcl_info, $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_CONTACT, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     CleanArray($_REQUEST);
     $oDB = new dclDB();
     $oView = CreateObject('dcl.boView');
     $oView->table = 'dcl_contact';
     $oView->AddDef('columnhdrs', '', array(STR_CMMN_ID, STR_CMMN_ACTIVE, STR_CMMN_LASTNAME, STR_CMMN_FIRSTNAME, 'Organization', 'Phone', 'Email', 'Internet'));
     $oView->AddDef('columns', '', array('contact_id', 'active', 'last_name', 'first_name'));
     $oView->AddDef('order', '', array('last_name', 'first_name', 'contact_id'));
     $oView->numrows = 25;
     $filterActive = DCL_Sanitize::ToYN($_REQUEST['filterActive']);
     if ($filterActive == 'Y' || $filterActive == 'N') {
         $oView->AddDef('filter', 'active', "'{$filterActive}'");
     }
     $filterSearch = isset($_REQUEST['filterSearch']) ? $_REQUEST['filterSearch'] : '';
     if ($filterSearch != '') {
         $oView->AddDef('filterlike', 'last_name', $filterSearch);
     }
     $filterStartsWith = isset($_REQUEST['filterStartsWith']) ? $_REQUEST['filterStartsWith'] : '';
     if ($filterStartsWith != '') {
         $oView->AddDef('filterstart', 'last_name', $filterStartsWith);
     }
     $filterOrgID = isset($_REQUEST['org_id']) ? DCL_Sanitize::ToInt($_REQUEST['org_id']) : null;
     if ($filterOrgID !== null) {
         $oView->AddDef('filter', 'dcl_org_contact.org_id', $filterOrgID);
     }
     $this->sColumnTitle = STR_CMMN_OPTIONS;
     $this->bShowPager = true;
     $this->Render($oView);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:35,代码来源:class.htmlContactBrowse.inc.php

示例10: dbmodify

 function dbmodify()
 {
     global $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_FAQQUESTION, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     if (($iID = @DCL_Sanitize::ToInt($_REQUEST['topicid'])) === null) {
         trigger_error('Data sanitize failed.');
         return;
     }
     $objF =& CreateObject('dcl.dbFaqtopics');
     if ($objF->Load($iID) == -1) {
         return;
     }
     $obj =& CreateObject('dcl.dbFaqquestions');
     $obj->InitFromGlobals();
     $obj->active = @DCL_Sanitize::ToYN($_REQUEST['active']);
     $obj->modifyby = $GLOBALS['DCLID'];
     $obj->modifyon = DCL_NOW;
     $obj->Edit();
     $objH =& CreateObject('dcl.htmlFaqtopics');
     $objH->ShowTopic($objF);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:24,代码来源:class.boFaqquestions.inc.php

示例11: modify

 function modify(&$aSource)
 {
     global $dcl_info, $g_oSec;
     commonHeader();
     if ($this->oDB->Load($aSource['resid']) == -1) {
         return;
     }
     if (!$g_oSec->HasPerm(DCL_ENTITY_RESOLUTION, DCL_PERM_MODIFY, $this->oDB->ticketid)) {
         return PrintPermissionDenied();
     }
     $iOrigStatus = $this->oDB->status;
     $this->oDB->InitFromArray($aSource);
     $this->oDB->is_public = @DCL_Sanitize::ToYN($_REQUEST['is_public']);
     $oTicket =& CreateObject('dcl.dbTickets');
     $oTicket->Load($this->oDB->ticketid);
     $oTicket->lastactionon = DCL_NOW;
     $notify = '4';
     if ($oTicket->IsLastResolution($this->oDB->ticketid, $this->oDB->resid)) {
         if ($this->oDB->status != $oTicket->status) {
             $oStatus =& CreateObject('dcl.dbStatuses');
             $notify .= ',3';
             $oTicket->statuson = DCL_NOW;
             if ($oStatus->GetStatusType($this->oDB->status) == 2) {
                 $notify .= ',2';
                 $oTicket->closedby = $GLOBALS['DCLID'];
                 $oTicket->closedon = DCL_NOW;
             } else {
                 if ($oStatus->GetStatusType($this->oDB->status) == 1) {
                     $notify .= ',1';
                 }
             }
             $oTicket->status = $this->oDB->status;
         } else {
             $this->oDB->status = $iOrigStatus;
         }
     }
     $this->oDB->BeginTransaction();
     $this->oDB->Edit();
     $oTicket->Edit();
     $this->oDB->EndTransaction();
     $objWtch =& CreateObject('dcl.boWatches');
     $objWtch->sendTicketNotification($oTicket, $notify);
     @$this->sendCustomerResponseEmail($oTicket);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:44,代码来源:class.boTicketresolutions.inc.php

示例12: submitModify

 function submitModify()
 {
     global $g_oSec;
     commonHeader();
     if (($id = DCL_Sanitize::ToInt($_REQUEST['hotlist_id'])) === null) {
         trigger_error('Data sanitize failed.');
         return;
     }
     if (!$g_oSec->HasPerm(DCL_ENTITY_HOTLIST, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     $obj = CreateObject('dcl.boHotlist');
     CleanArray($_REQUEST);
     $active = @DCL_Sanitize::ToYN($_REQUEST['active']);
     $obj->modify(array('hotlist_id' => $id, 'hotlist_tag' => $_REQUEST['hotlist_tag'], 'active' => $active, 'hotlist_desc' => $_REQUEST['hotlist_desc'], 'closed_by' => $active == 'Y' ? null : $GLOBALS['DCLID'], 'closed_on' => $active == 'Y' ? null : DCL_NOW));
     $oWS = createObject('dcl.htmlHotlistBrowse');
     $oWS->show();
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:18,代码来源:class.htmlHotlistForm.inc.php

示例13: dbmodify

 function dbmodify()
 {
     global $dcl_info, $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_FORMTEMPLATES, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     if (($iID = @DCL_Sanitize::ToInt($_REQUEST['dcl_chklst_tpl_id'])) === null) {
         trigger_error('Data sanitize failed.');
         return;
     }
     $o =& CreateObject('dcl.dbChklstTpl');
     if ($o->Load($iID) != -1) {
         $sFileName = @DCL_Sanitize::ToFileName('userfile');
         if ($sFileName !== null) {
             $sName = '';
             $oXML =& CreateObject('dcl.xmlDoc');
             $oXML->ParseFile($sFileName);
             $oXML->FindChildNode($oXML->root, 'Name');
             if ($oXML->currentNode != NULL) {
                 $sName = $oXML->currentNode->data;
                 $oXML->FindChildNode($oXML->root, 'Version');
                 if ($oXML->currentNode != NULL) {
                     if ($sName != '') {
                         $sName .= ' ';
                     }
                     $sName .= $oXML->currentNode->data;
                 }
                 $o->dcl_chklst_tpl_name = $sName;
             }
         }
         $o->dcl_chklst_tpl_active = @DCL_Sanitize::ToYN($_REQUEST['dcl_chklst_tpl_active']);
         $o->BeginTransaction();
         $o->Edit();
         if ($sFileName !== null) {
             // Insert successful, now stow file in its place
             $filePath = $this->GetTplPath($o->dcl_chklst_tpl_id, true);
             if (copy($sFileName, $filePath)) {
                 $o->EndTransaction();
             } else {
                 $o->RollbackTransaction();
                 echo STR_BO_UPLOADERR;
             }
         } else {
             $o->EndTransaction();
         }
     }
     $this->show();
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:49,代码来源:class.boChecklistTpl.inc.php

示例14: show

 function show()
 {
     global $dcl_info, $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_ORG, DCL_PERM_VIEW)) {
         return PrintPermissionDenied();
     }
     $oView = CreateObject('dcl.boView');
     $oView->table = 'dcl_org';
     $oView->AddDef('columnhdrs', '', array(STR_CMMN_ID, STR_CMMN_ACTIVE, STR_CMMN_NAME, 'Phone', 'Email', 'Internet'));
     $oView->AddDef('columns', '', array('org_id', 'active', 'name', 'dcl_org_phone.phone_number', 'dcl_org_email.email_addr', 'dcl_org_url.url_addr'));
     $oView->AddDef('order', '', array('name'));
     $oView->numrows = 25;
     $filterActive = @DCL_Sanitize::ToYN($_REQUEST['filterActive']);
     if ($filterActive == 'Y' || $filterActive == 'N') {
         $oView->AddDef('filter', 'active', "'{$filterActive}'");
     }
     $filterSearch = isset($_REQUEST['filterSearch']) ? $_REQUEST['filterSearch'] : '';
     if ($filterSearch != '') {
         $oView->AddDef('filterlike', 'name', $filterSearch);
     }
     $filterStartsWith = isset($_REQUEST['filterStartsWith']) ? $_REQUEST['filterStartsWith'] : '';
     if ($filterStartsWith != '') {
         $oView->AddDef('filterstart', 'name', $filterStartsWith);
     }
     $this->sColumnTitle = STR_CMMN_OPTIONS;
     $this->bShowPager = true;
     $this->Render($oView);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:29,代码来源:class.htmlOrgBrowse.inc.php

示例15: dbmodify

 function dbmodify()
 {
     global $dcl_info, $g_oSec;
     commonHeader();
     if (!$g_oSec->HasPerm(DCL_ENTITY_TIMECARD, DCL_PERM_MODIFY)) {
         return PrintPermissionDenied();
     }
     $objTC =& CreateObject('dcl.dbTimeCards');
     $objOldTC =& CreateObject('dcl.dbTimeCards');
     $objTC->InitFromGlobals();
     if ($g_oSec->IsPublicUser()) {
         $objTC->is_public = 'Y';
     } else {
         $objTC->is_public = @DCL_Sanitize::ToYN($_REQUEST['is_public']);
     }
     if ($objOldTC->Load($objTC->id) == -1) {
         return;
     }
     if ($g_oSec->IsPublicUser() && $objOldTC->is_public == 'N') {
         return PrintPermissionDenied();
     }
     // If the hours change, we'll need to adjust the workorder
     $hoursDiff = $objTC->hours - $objOldTC->hours;
     $objWO =& CreateObject('dcl.dbWorkorders');
     if ($objWO->Load($objTC->jcn, $objTC->seq) == -1) {
         return;
     }
     $woChanged = false;
     $notify = '4';
     // See if any time cards were issued after this one.  If not, assume
     // that this time card was the last one entered and affected the work order
     // status when input.  In other words, adjust as needed.
     if ($objTC->status != $objOldTC->status) {
         $notify .= ',3';
         $objQueryTC =& CreateObject('dcl.dbTimeCards');
         if ($objQueryTC->IsLastTimeCard($objTC->id, $objTC->jcn, $objTC->seq)) {
             // We're the last one!  This does (of course) assume that time cards
             // are entered sequentially in correct chronological order.
             if ($objTC->status != $objWO->status) {
                 $objWO->status = $objTC->status;
                 $objWO->statuson = date($dcl_info['DCL_TIMESTAMP_FORMAT']);
                 $woChanged = true;
                 $oStatus =& CreateObject('dcl.dbStatuses');
                 if ($oStatus->GetStatusType($objTC->status) == 2) {
                     $objWO->closedby = $objTC->actionby;
                     $objWO->closedon = $objTC->actionon;
                     $objWO->etchours = 0.0;
                     $notify .= ',2';
                     // also need to close all incomplete tasks and warn user if it happens
                     $this->closeIncompleteTasks($objTC->jcn, $objTC->seq);
                 }
             }
         } else {
             // Don't allow status change if more are left.  Last time card controls status of WO
             $objTC->status = $objOldTC->status;
         }
     }
     if ($hoursDiff != 0) {
         $objWO->totalhours += $hoursDiff;
         $woChanged = true;
     }
     if ($woChanged) {
         $objTC->BeginTransaction();
     }
     $objTC->Edit();
     if ($woChanged) {
         $objWO->edit();
         $objTC->EndTransaction();
     }
     $objWtch =& CreateObject('dcl.boWatches');
     $objWtch->sendNotification($objWO, $notify);
     $obj =& CreateObject('dcl.htmlWorkOrderDetail');
     $obj->Show($objTC->jcn, $objTC->seq);
 }
开发者ID:ljvblfz,项目名称:mysoftwarebrasil,代码行数:74,代码来源:class.boTimecards.inc.php


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