當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Shipment::hasContact方法代碼示例

本文整理匯總了PHP中Shipment::hasContact方法的典型用法代碼示例。如果您正苦於以下問題:PHP Shipment::hasContact方法的具體用法?PHP Shipment::hasContact怎麽用?PHP Shipment::hasContact使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Shipment的用法示例。


在下文中一共展示了Shipment::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


注:本文中的Shipment::hasContact方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。