Example #1
0
 /**
  * Replicates module_list($refresh, $bootstrap_refresh, $sort, NULL)
  *
  * @see module_list()
  *
  * @param bool $refresh
  * @param bool $bootstrap_refresh
  * @param bool $sort
  *
  * @return string[]
  */
 function moduleList($refresh = FALSE, $bootstrap_refresh = FALSE, $sort = FALSE)
 {
     if (empty($this->list) || $refresh) {
         $this->list = array();
         $sorted_list = NULL;
         if ($refresh) {
             // For the $refresh case, make sure that system_list() returns fresh
             // data.
             $this->drupalStatic->resetKey('system_list');
         }
         if ($bootstrap_refresh) {
             $this->list = $this->systemList->systemListBootstrap();
         } else {
             // Not using drupal_map_assoc() here as that requires common.inc.
             $this->list = array_keys($this->systemList->systemListModuleEnabled());
             $this->list = !empty($this->list) ? array_combine($this->list, $this->list) : array();
         }
     }
     if ($sort) {
         return $this->moduleListSorted();
     }
     if (count($this->list)) {
         # HackyLog::log($this->list);
     }
     return $this->list;
 }
 public function actiondropdownJSONCategory($vendor_id = false, $vendor_invoice_id = false)
 {
     $vendor_id = isset($_GET['vendor_id']) ? $_GET['vendor_id'] : 0;
     $quotation_id = isset($_GET['vendor_invoice_id']) ? $_GET['vendor_invoice_id'] : 0;
     $category_arr = SystemList::model()->getItemsForListCode('expenses_category', LbVendor::LB_QUERY_RETURN_TYPE_DROPDOWN_ARRAY);
     $category_arr = SystemList::model()->findAll('system_list_code = "expenses_category"');
     $ordered_results = array();
     $ordered_results[0] = array('value' => '0', 'text' => 'Choose category') + $ordered_results;
     foreach ($category_arr as $value) {
         $ordered_results[] = array('value' => $value['system_list_item_id'], 'text' => $value['system_list_item_name']);
     }
     LBApplication::renderPlain($this, array('content' => CJSON::encode($ordered_results)));
 }
Example #3
0
 function insertListItem($listName, $itemName)
 {
     $model = new SystemList();
     $model->system_list_code = $listName;
     $model->system_list_item_name = $itemName;
     $model->system_list_item_code = $listName . '_' . $itemName;
     $model->system_list_item_active = '1';
     $condition = 'system_list_item_code=:id';
     if (!$model->getItemByCode($listName . '_' . $itemName)) {
         $model->insert();
     }
 }
Example #4
0
echo $form->dropDownListRow($invoiceModel, 'lb_invoice_id', $option_invoice, array('multiple' => true));
echo $form->textAreaRow($model, 'lb_expenses_note', array('rows' => '3', 'cols' => '40', 'style' => 'width:210px;'));
$recurring_arr = SystemList::model()->getItemsForListCode('recurring');
$option_recurring = array('' => 'Choose Recurring');
//+$recurring_arr;
echo $form->dropDownListRow($model, 'lb_expenses_recurring_id', $option_recurring);
//            $bank_accounts = LbBankAccount::model()->getBankAccount(Yii::app()->user->id);
$bank_account_arr = array();
if (count($bankaccounts) > 0) {
    foreach ($bankaccounts as $data_bank) {
        $bank_account_arr[$data_bank->lb_record_primary_key] = $data_bank->lb_bank_account;
    }
}
$option_bank_acc = array('' => 'Choose Bank Account') + $bank_account_arr;
echo $form->dropDownListRow($model, 'lb_expenses_bank_account_id', $option_bank_acc);
$tax_arr = SystemList::model()->getItemsForListCode('taxes');
$option_tax = array('' => '--') + $tax_arr;
echo '<div class="control-group">';
echo CHtml::label('Taxes', 'LbExpenses_lb_tax_id', array('class' => 'control-label'));
echo '<div class="controls">';
echo CHtml::dropDownList('LbExpenses_lb_tax_id', '', $option_tax, array('style' => 'width:50px;'));
echo '&nbsp;&nbsp;&nbsp;';
echo CHtml::textField('LbExpenses_lb_expenses_tax_total', '', array('class' => 'span2'));
echo '&nbsp;&nbsp;&nbsp;';
echo CHtml::link('More tax', '#', array('onclick' => 'addTaxClick(); return false;'));
echo '</div>';
echo '</div>';
?>
        
        <div class="control-group">
            <?php 
Example #5
0
//
//    echo '</div><br/>';
//$this->widget('zii.widgets.CDetailView', array(
//	'data'=>$model,
//	'attributes'=>array(
//		'lb_record_primary_key',
//		'lb_category_id',
//		'lb_expenses_amount',
//		'lb_expenses_date',
//		'lb_expenses_recurring_id',
//		'lb_expenses_brank_account_id',
//		'lb_expenses_note',
//	),
//));
//echo '<div style="float: left; width: 49%;">';
$this->widget('editable.EditableDetailView', array('id' => 'expenses-detail', 'data' => $model, 'url' => $model->getActionURL('ajaxUpdateField'), 'placement' => 'right', 'attributes' => array(array('name' => 'lb_expenses_no', 'editable' => false), array('name' => 'lb_category_id', 'editable' => array('type' => 'select', 'source' => array('0' => 'Choose Category') + CHtml::listData(SystemList::model()->getItemsForListCode('expenses_category'), 'system_list_item_id', 'system_list_item_name'))), array('name' => 'lb_expenses_date', 'editable' => array('type' => 'date', 'viewformat' => 'dd-mm-yyyy', 'format' => 'yyyy-mm-dd')), 'lb_expenses_amount', array('name' => 'lb_expenses_note', 'editable' => array('type' => 'textarea')), array('name' => 'lb_expenses_recurring_id', 'editable' => array('type' => 'select', 'source' => array('0' => 'Choose Recurring') + CHtml::listData(UserList::model()->getItemsForListCode('recurring'), 'system_list_item_id', 'system_list_item_name'))), array('name' => 'lb_expenses_bank_account_id', 'editable' => array('type' => 'select', 'source' => array('' => 'Choose bank account') + CHtml::listData(UserList::model()->getItemsForListCode('BankAcount'), 'system_list_item_id', 'system_list_item_name'))))));
$customers = LbExpensesCustomer::model()->getCustomerExpenses($model->lb_record_primary_key);
$customer_view = '';
if (count($customers) > 0) {
    foreach ($customers as $cus) {
        $client = LbCustomer::model()->findByPk($cus->lb_customer_id);
        $customer_view .= $client['lb_customer_name'] . '; ';
    }
}
$invoices = LbExpensesInvoice::model()->getExpensesInvoice($model->lb_record_primary_key);
$invoice_view = '';
if (count($invoices) > 0) {
    foreach ($invoices as $inv) {
        $invoice = LbInvoice::model()->findByPk($inv->lb_invoice_id);
        $invoice_view .= $invoice['lb_invoice_no'] . '; ';
    }
Example #6
0
}
$billingName = false;
if ($model->lb_vendor_supplier_address) {
    $informationAdd = LbCustomerAddress::model()->findByPk($model->lb_vendor_supplier_address);
    $billingName = $informationAdd['lb_customer_address_line_1'] . '. ' . $informationAdd['lb_customer_address_line_2'] . '<br />';
    //    $billingName .=$informationAdd['lb_customer_address_postal_code'].'<br>';
    //    $billingName .=$informationAdd['lb_customer_address_website_url'].'<br>';
}
$attentionInformation = false;
if ($model->lb_vendor_supplier_attention_id) {
    $attention = LbCustomerContact::model()->findByPk($model->lb_vendor_supplier_attention_id);
    $attentionInformation = $attention['lb_customer_contact_first_name'] . ' ' . $attention['lb_customer_contact_last_name'];
}
$list_name = false;
if ($model->lb_vendor_category) {
    $list_name = SystemList::model()->findByPk($model->lb_vendor_category)['system_list_item_code'];
}
$tbody = '<table border="0" style="width:100%;" cellpadding="0" cellspacing="0">';
$tbody .= '<tr>' . '<td style="width:100px;"><b>To: </b> </td><td>' . $customerName . '</td>' . '</tr><br />';
$tbody .= '<tr>' . '<td><b>Billing Address: </b></td><td>' . $billingName . '</td>' . '</tr>';
$tbody .= '<tr>' . '<td><b>Attention: </b></td><td>' . $attentionInformation . '</td>' . '</tr>';
$tbody .= '<tr>' . '<td><b>Category: </b></td><td>' . $list_name . '</td>' . '</tr>';
$tbody .= '<tr>' . '<td><b>Subject:</b></td><td>' . $model->lb_vendor_subject . '</td></tr>';
$tbody .= '</table>';
echo $tbody;
echo '<br>';
echo '<br>';
echo '<br>';
//Item
$modelItem = LbVendorItem::model()->findAll('lb_vendor_id=55');
if (count($modelItem) > 0) {
Example #7
0
                    var $tip = $(this).data("editableContainer").tip();
                    var dropdown = $tip.find("select");
                    $(dropdown).bind("change", function(e){
                        onChangeAttentionDropdown(e,' . $model->lb_record_primary_key . ');
                    });
                }'));
echo '</div>';
// end attention
echo '<br />';
//echo Yii::t('lang','Category');echo '&nbsp;&nbsp;&nbsp;';
//        $category_arr = SystemList::model()->getItemsForListCode('expenses_category');
//             echo CHtml::dropDownList('lb_category_id', '', array(''=>'All')+CHtml::listData($category_arr, 'system_list_item_id', 'system_list_item_name'), array('style'=>'width:150px;'));echo '&nbsp;&nbsp;&nbsp;';
?>

<?php 
$category_arr = SystemList::model()->getItemsForListCode('expenses_category');
//            echo dropDownListRow($model, 'lb_category_id', CHtml::listData($category_arr, 'system_list_item_id', 'system_list_item_name'));
?>
<div id="container-invoice-customer-subject">
    <h4><?php 
echo Yii::t('lang', 'Subject');
?>
:</h4>
    <?php 
$this->widget('editable.EditableField', array('type' => 'textarea', 'inputclass' => 'input-large-textarea', 'emptytext' => 'Enter invoice subject', 'model' => $model, 'attribute' => 'lb_vendor_subject', 'url' => $model->getActionURLNormalized('ajaxUpdateField'), 'placement' => 'right', 'htmlOptions' => array('style' => 'text-decoration: none; border-bottom: none; color: #777'), 'options' => array()));
$lb_invoice_customer_id = $model->lb_record_primary_key;
$manage = LbVendor::model()->findByPk($lb_invoice_customer_id);
?>
</div>
<script language="javascript">
    var lb_invoice_customer_id = "<?php 
 public function loadModel($id)
 {
     $model = SystemList::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }