Last active
December 17, 2015 21:19
-
-
Save aqualad/5674082 to your computer and use it in GitHub Desktop.
onEdit Anonymous Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
onEdit: | |
1. Clear the form | |
2. Select query for the CustomerID on invoices table | |
3. Call WebCRM::populateControls() | |
4. Call a method named populateItemList($invoice_id) | |
4a) populateItemList() should query the invoice_lines table where InvoiceID = $invoice_id | |
4b) It should then iterate through the results and create the controls for each row (ctlLabel x5, ctlLinkButton x2) | |
*/ | |
$buildlabels = function($defs) { | |
$ctls = []; | |
foreach($defs as $def) | |
$ctls[] = new ctlLabel($this, [ | |
'type' => 'ctlLabel', | |
'name' => $def['name'], | |
'class' => 'BoldLabel', | |
'style' => ... | |
'properties' => ['text' => $def['text'] | |
], $this->controls['product_list'] | |
); | |
return $ctls; | |
}; | |
$labels = $buildlabels( [ | |
['name'] => 'invoicdeproduct.$ctr', | |
['text'] => 'assdfasdf', | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment