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


PHP Receipt::hasContact方法代码示例

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


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

示例1: btnDelete_Click

 protected function btnDelete_Click($strFormId, $strControlId, $strParameter)
 {
     $items = $this->dtgContact->getSelected('ContactId');
     // Show confirm "Are you sure you want to {delete/edit} these objects?"
     if (count($items) > 0) {
         $this->lblWarning->Text = "";
         if (!$this->dlgDelete->Display) {
             $arrToBeSkipped = array();
             foreach ($items as $item) {
                 // Check if any Shipments or Receipts include selected contact
                 if (Shipment::hasContact($item) || Receipt::hasContact($item)) {
                     // append $item to  be skipped
                     $arrToBeSkipped[] = $item;
                 } else {
                     $this->arrToDelete[] = $item;
                 }
             }
             if (count($arrToBeSkipped) > 0) {
                 if (count($arrToBeSkipped) == 1) {
                     $toBe = 'is';
                     $ending = '';
                 } else {
                     $toBe = 'are';
                     $ending = 's';
                 }
                 // Show dialog box "There are {number} {entity_type}s that are not able to be deleted. Would you like to continue the deletion process, skipping these items?"
                 $this->dlgDelete->Text = sprintf("There %s %s contact%s that %s not able to be deleted.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t Would you like to continue the deletion process,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t skipping these item%s?<br />", $toBe, count($arrToBeSkipped), $ending, $toBe, $ending);
                 $this->dlgDelete->ShowDialogBox();
             } else {
                 if (count($this->arrToDelete) > 0) {
                     Contact::DeleteSelected($this->arrToDelete);
                     $this->arrToDelete = array();
                     QApplication::Redirect('');
                 }
             }
             //	print_r(get_class_methods(get_class($this->dlgDelete)));exit;//$this->dlgDelete->ShowDialogBox() ;
         }
     } else {
         $this->lblWarning->Text = "You haven't chosen any Contact to Delete";
     }
 }
开发者ID:jdellinger,项目名称:tracmor,代码行数:41,代码来源:contact_list.php


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