本文整理汇总了PHP中xepan\base\Page类的典型用法代码示例。如果您正苦于以下问题:PHP Page类的具体用法?PHP Page怎么用?PHP Page使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Page类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
parent::init();
// $emp->addCondition('status','Active');
$emp = $this->add('xepan\\hr\\Model_Employee');
$emp->addCondition('status', 'Active');
$emp_nav = $this->add('xepan\\communication\\View_InternalMessageEmployeeList', null, 'message_navigation');
$emp_nav->setModel($emp, ['name']);
$emp_id = $this->app->stickyGET('employee_id');
$msg_m = $this->add('xepan\\communication\\Model_Communication_AbstractMessage');
$msg_m->addCondition([['from_raw', 'like', '%"' . $this->app->employee->id . '"%'], ['to_raw', 'like', '%"' . $this->app->employee->id . '"%']]);
if ($emp_id) {
$employee = $this->add('xepan\\hr\\Model_Employee');
$employee->load($emp_id);
$msg_m->addCondition([['from_raw', 'like', '%"' . $employee->id . '"%'], ['to_raw', 'like', '%"' . $employee->id . '"%']]);
}
// $msg_m->setOrder('id','desc');
$msg_list = $this->add('xepan\\communication\\View_Lister_InternalMSGList', null, 'message_lister');
$msg_list->setModel($msg_m);
$msg_list->add('xepan\\base\\Controller_Avatar', ['options' => ['size' => 50, 'border' => ['width' => 0]], 'name_field' => 'contact']);
$paginator = $msg_list->add('xepan\\base\\Paginator', ['ipp' => 10]);
$paginator->setRowsPerPage(10);
//trigger reload
$msg_list->addClass('xepan-internal-message-trigger-reload');
// $msg_list->js('reload')->reload();
$compose_msg = $this->add('xepan\\communication\\View_ComposeMessagePopup', ['employee_id' => $emp_id], 'message_compose_view');
$emp_nav->js('click', [$compose_msg->js()->html(' ')->reload(['employee_id' => $this->js()->_selectorThis()->data('id')]), $msg_list->js()->html('<div style="width:100%"><img style="width:20%;display:block;margin:auto;" src="vendor\\xepan\\communication\\templates\\images\\email-loader.gif"/></div>')->reload(['employee_id' => $this->js()->_selectorThis()->data('id')])])->_selector('.internal-conversion-emp-list');
}
示例2: init
function init()
{
parent::init();
$action = $this->api->stickyGET('action') ?: 'view';
$document_id = $this->app->stickyGET('document_id');
$sale_odr_dtl = $this->add('xepan\\commerce\\Model_SalesOrder')->tryLoadBy('id', $this->api->stickyGET('document_id'));
$view_field = ['contact_id', 'document_no', 'type', 'billing_address', 'billing_city', 'billing_pincode', 'shipping_address', 'shipping_city', 'shipping_pincode', 'gross_amount', 'discount_amount', 'net_amount', 'delivery_date', 'tnc_text', 'narration', 'exchange_rate', 'currency'];
$form_field = ['contact_id', 'document_no', 'created_at', 'due_date', 'billing_address', 'billing_country_id', 'billing_state_id', 'billing_city', 'billing_pincode', 'shipping_address', 'shipping_country_id', 'shipping_state_id', 'shipping_city', 'shipping_pincode', 'discount_amount', 'narration', 'exchange_rate', 'currency_id', 'tnc_id'];
$dv = $this->add('xepan\\commerce\\View_QSPAddressJS')->set('');
$view = $this->add('xepan\\commerce\\View_QSP', ['qsp_model' => $sale_odr_dtl, 'qsp_view_field' => $view_field, 'qsp_form_field' => $form_field]);
$consumable_view = $this->add('xepan\\commerce\\View_StockAvailibility', ['sale_order_id' => $sale_odr_dtl->id]);
if ($document_id) {
$consumable_view->setModel($sale_odr_dtl->orderItems());
}
// $view->document->effective_template->setHTML('consumable_item_view',$consumable_view->getHtml());
$view->document_item->js('reload', $consumable_view->js()->reload(null, null, [$this->app->url(null, ['cut_object' => $consumable_view->name])]));
$view->js('click')->_selector('a.new-qsp')->univ()->location($this->app->url(null, ['action' => 'add', 'document_id' => false]));
$vp = $this->add('VirtualPage');
$vp->set(function ($p) {
$order_id = $p->app->stickyGET('order_id');
$attachments = $p->add('xepan\\commerce\\Model_QSP_DetailAttachment');
$attachments->addCondition('qsp_detail_id', $order_id);
$grid = $p->add('xepan\\base\\Grid', null, null, ['view\\qsp\\attachments']);
$grid->setModel($attachments);
});
$view->on('click', '.order-export-attachments', function ($js, $data) use($vp) {
return $js->univ()->dialogURL("EXPORT ATTACHMENTS", $this->api->url($vp->getURL(), ['order_id' => $data['id']]));
});
if ($action != 'view') {
$contact_field = $view->document->form->getElement('contact_id');
$contact_field->model->addCondition('type', 'Customer');
$contact_field->js('change', $dv->js()->reload(['changed_contact_id' => $contact_field->js()->val()]));
}
}
示例3: init
function init()
{
parent::init();
$this->app->side_menu->addItem(['Social Configuration', 'icon' => 'fa fa-globe'], 'xepan_marketing_socialconfiguration')->setAttr(['title' => 'Social Configuration']);
$this->app->side_menu->addItem(['Lead Source', 'icon' => 'fa fa-user'], 'xepan_marketing_leadsource')->setAttr(['title' => 'Lead Source']);
$this->app->side_menu->addItem(['External Configuration', 'icon' => 'fa fa-gears'], 'xepan_marketing_externalconfiguration')->setAttr(['title' => 'External Configuration']);
}
示例4: init
function init()
{
parent::init();
$contact = $this->add('xepan\\base\\Model_Contact')->load($this->api->stickyGET('contact_id'));
$contact_view = $this->add('xepan\\base\\View_Contact');
$contact_view->setModel($contact);
}
示例5: init
function init()
{
parent::init();
$tra = $this->add('xepan\\accounts\\Model_Transaction')->load(17);
$this->form = $form = $this->add('xepan\\accounts\\Form_EntryRunner');
$form->setModel($tra);
}
示例6: init
function init()
{
parent::init();
$m = $this->add('xepan/marketing/Model_Content');
$m->load($_GET['content_id']);
$this->add('View')->setHtml($m['message_blog']);
}
示例7: init
function init()
{
parent::init();
$config_m = $this->add('xepan\\base\\Model_ConfigJsonModel', ['fields' => ['subject' => 'Line', 'body' => 'xepan\\base\\RichText', 'master' => 'xepan\\base\\RichText'], 'config_key' => 'PRODUCTION_JOBCARD_SYSTEM_CONFIG', 'application' => 'production']);
$config_m->add('xepan\\hr\\Controller_ACL');
$config_m->tryLoadAny();
$form = $this->add('Form', null, 'jobcard-received');
$form->setModel($config_m, ['subject', 'body', 'master']);
$form->getElement('subject')->set($config_m['subject'])->setFieldHint(' ')->setCaption('Subject');
$form->getElement('body')->set($config_m['body'])->setFieldHint(' ')->setCaption('Message');
$form->getElement('master')->set($config_m['master'])->setFieldHint('{$status},{$next_department},{$id},{$order_no},{$created_at},{$order_created_at},{$due_date},{$order_item},{$extra_info},{$order_item_quantity},{$extra_notes}')->setCaption('Master');
$save = $form->addSubmit('Save')->addClass('btn btn-primary');
$reset = $form->addSubmit('Reset')->addClass('btn btn-primary');
if ($form->isSubmitted()) {
if ($form->isClicked($save)) {
$form->save();
$form->js(null, $form->js()->reload())->univ()->successMessage('Information Updated')->execute();
}
if ($form->isClicked($reset)) {
$temp = file_get_contents(realpath("../vendor/xepan/production/templates/default/jobcard-received-subject.html"));
$temp1 = file_get_contents(realpath("../vendor/xepan/production/templates/default/jobcard-received-body.html"));
$temp2 = file_get_contents(realpath("../vendor/xepan/production/templates/default/jobcard-received-print.html"));
$config_m['subject'] = $temp;
$config_m['body'] = $temp1;
$config_m['master'] = $temp2;
$config_m->save();
$form->js(null, $form->js()->reload())->univ()->successMessage('Information Resetted')->execute();
}
}
}
示例8: init
function init()
{
parent::init();
$emp_emails = $this->app->employee->getAllowSupportEmail();
$email_setting = $this->add('xepan\\communication\\Model_Communication_EmailSetting');
$email_setting->addCondition('is_active', true);
$email_setting->addCondition('id', $emp_emails);
$allow_email = [];
foreach ($emp_emails as $email) {
$allow_email[] = $email;
}
// var_dump($allow_email);
$st = $this->add('xepan\\crm\\Model_SupportTicket');
$st->addCondition('to_id', array_merge([0], $allow_email));
$st->addCondition('status', '<>', 'Draft');
$icon_array = $this->app->status_icon;
$model_class = get_class($st);
// throw new \Exception($model_class, 1);
unset($st->status[0]);
$counts = $st->_dsql()->del('fields')->field('status')->field('count(*) counts')->group('Status')->get();
$counts_redefined = [];
$total = 0;
foreach ($counts as $cnt) {
$counts_redefined[$cnt['status']] = $cnt['counts'];
$total += $cnt['counts'];
}
if ($this->add_all) {
$this->app->side_menu->addItem(['All', 'icon' => $icon_array[$model_class]['All'], 'badge' => [$total, 'swatch' => ' label label-primary label-circle pull-right']], $this->api->url(null, ['status' => null]), ['status'])->setAttr(['title' => 'All']);
}
foreach ($st->status as $s) {
// echo $s."</br>";
$this->app->side_menu->addItem([$s, 'icon' => $icon_array[$model_class][$s], 'badge' => [$counts_redefined[$s], 'swatch' => ' label label-primary label-circle pull-right']], $this->api->url(null, ['status' => $s]), ['status'])->setAttr(['title' => $s]);
}
}
示例9: init
function init()
{
parent::init();
$department = $this->add('xepan\\hr\\Model_Department');
$department->add('xepan\\hr\\Controller_SideBarStatusFilter');
if ($status = $this->app->stickyGET('status')) {
$department->addCondition('status', $status);
}
$department->setOrder('production_level', 'asc');
$crud = $this->add('xepan\\hr\\CRUD', null, null, ['view/department/department-grid']);
$crud->grid->addPaginator(50);
if (!$crud->isEditing()) {
$crud->grid->template->trySet('dept-url', $this->app->url('xepan_hr_structurechart'));
}
$crud->setModel($department);
$crud->add('xepan\\base\\Controller_MultiDelete');
if ($crud->form->model['is_system']) {
$crud->form->getElement('production_level')->destroy();
}
$crud->grid->addHook('formatRow', function ($g) {
if ($g->model['is_system']) {
$g->current_row_html['edit'] = '<span class="fa-stack table-link"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-pencil fa-stack-1x fa-inverse"></i></span>';
$g->current_row_html['delete'] = '<span class="table-link fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-trash-o fa-stack-1x fa-inverse"></i></span>';
$g->current_row_html['action'] = '';
}
});
$f = $crud->grid->addQuickSearch(['name']);
if (!$crud->isEditing()) {
$crud->grid->js('click')->_selector('.do-view-department-post')->univ()->frameURL('Department Post', [$this->api->url('xepan_hr_post'), 'department_id' => $this->js()->_selectorThis()->closest('[data-id]')->data('id')]);
$crud->grid->js('click')->_selector('.do-view-department-employee')->univ()->frameURL('Department Employee', [$this->api->url('xepan_hr_employee'), 'department_id' => $this->js()->_selectorThis()->closest('[data-id]')->data('id'), 'status' => '']);
}
}
示例10: init
function init()
{
parent::init();
$department_id = $this->app->stickyGET('dept_id');
$attendances = $this->add('xepan\\hr\\Model_Employee_Attandance');
$emp_j = $attendances->join('employee.contact_id', 'employee_id');
$emp_j->addField('department_id');
$attendances->addExpression('emp_status')->set(function ($m, $q) {
$emp = $this->add('xepan\\hr\\Model_Employee');
$emp->addCondition('id', $m->getElement('employee_id'));
$emp->setLimit(1);
return $emp->fieldQuery('status');
});
$attendances->addExpression('department_name')->set(function ($m, $q) {
$emp = $this->add('xepan\\hr\\Model_Department');
$emp->addCondition('id', $m->getElement('department_id'));
$emp->setLimit(1);
return $emp->fieldQuery('name');
});
$attendances->addCondition('emp_status', 'Active');
$attendances->addCondition('department_id', $department_id);
$attendances->addExpression('avg_late')->set($attendances->dsql()->expr('AVG([0])/60', [$attendances->getElement('late_coming')]));
$attendances->addExpression('avg_extra_work')->set($attendances->dsql()->expr('AVG([0])/60', [$attendances->getElement('extra_work')]));
$attendances->_dsql()->group('employee_id');
$this->grid = $this->add('xepan\\hr\\Grid', null, null, ['page\\widget\\employeeperformance']);
$this->grid->setModel($attendances, ['employee', 'avg_late', 'avg_extra_work']);
$this->grid->addQuickSearch(['employee']);
$this->grid->addPaginator(10);
$this->grid->addFormatter('avg_late', 'gmdate');
$this->grid->addFormatter('avg_extra_work', 'gmdate');
}
示例11: init
function init()
{
parent::init();
$attendances = $this->add('xepan\\hr\\Model_Employee_Attandance');
$emp_j = $attendances->join('employee.contact_id', 'employee_id');
$emp_j->addField('department_id');
$attendances->addExpression('emp_status')->set(function ($m, $q) {
$emp = $this->add('xepan\\hr\\Model_Employee');
$emp->addCondition('id', $m->getElement('employee_id'));
$emp->setLimit(1);
return $emp->fieldQuery('status');
});
$attendances->addExpression('department_name')->set(function ($m, $q) {
$emp = $this->add('xepan\\hr\\Model_Department');
$emp->addCondition('id', $m->getElement('department_id'));
$emp->setLimit(1);
return $emp->fieldQuery('name');
});
$attendances->addCondition('emp_status', 'Active');
$attendances->addExpression('avg_late')->set($attendances->dsql()->expr('AVG([0])/60', [$attendances->getElement('late_coming')]));
$attendances->addExpression('avg_extra_work')->set($attendances->dsql()->expr('AVG([0])/60', [$attendances->getElement('extra_work')]));
$attendances->_dsql()->group('department_id');
$this->grid = $this->add('xepan\\hr\\Grid', null, null, ['page\\widget\\averageperformance']);
$this->grid->setModel($attendances, ['department_name', 'department_id', 'avg_late', 'avg_extra_work']);
$this->grid->addQuickSearch(['department_name']);
$this->grid->addPaginator(10);
$this->grid->addFormatter('avg_late', 'gmdate');
$this->grid->addFormatter('avg_extra_work', 'gmdate');
$this->grid->js('click')->_selector('.average-performance-digging')->univ()->frameURL('Employee Average Performance', [$this->api->url('xepan_hr_widget_employeeperformance'), 'dept_id' => $this->js()->_selectorThis()->closest('[data-id]')->data('id')]);
}
示例12: init
function init()
{
parent::init();
$action = $this->api->stickyGET('action') ?: 'view';
$purchase_inv_dtl = $this->add('xepan\\commerce\\Model_PurchaseInvoice')->tryLoadBy('id', $this->api->stickyGET('document_id'));
$view_field = ['contact_id', 'document_no', 'type', 'billing_address', 'billing_city', 'billing_pincode', 'shipping_address', 'shipping_city', 'shipping_pincode', 'gross_amount', 'discount_amount', 'net_amount', 'delivery_date', 'tnc_text', 'narration', 'exchange_rate', 'currency'];
$form_field = ['contact_id', 'document_no', 'created_at', 'due_date', 'billing_address', 'billing_country_id', 'billing_state_id', 'billing_city', 'billing_pincode', 'shipping_address', 'shipping_country_id', 'shipping_state_id', 'shipping_city', 'shipping_pincode', 'discount_amount', 'narration', 'exchange_rate', 'currency_id', 'tnc_id'];
$dv = $this->add('xepan\\commerce\\View_QSPAddressJS')->set('');
$view = $this->add('xepan\\commerce\\View_QSP', ['qsp_model' => $purchase_inv_dtl, 'qsp_view_field' => $view_field, 'qsp_form_field' => $form_field]);
$view->js(true)->_selector('#shipping-hide')->hide();
$view->js('click')->_selector('a.new-qsp')->univ()->location($this->app->url(null, ['action' => 'add', 'document_id' => false]));
if ($action != 'view') {
$contact_field = $view->document->form->getElement('contact_id');
$contact_field->model->addCondition('type', 'Supplier');
$contact_field->js('change', $dv->js()->reload(['changed_contact_id' => $contact_field->js()->val()]));
}
if ($action == 'edit' && !$view->document_item->isEditing()) {
$view->app->addHook('post-submit', function ($f) use($purchase_inv_dtl) {
if ($_POST) {
$purchase_inv_dtl->addHook('afterSave', function ($m) {
$m->updateTransaction();
});
}
});
$m = $view->document_item->model;
$m->addHook('afterSave', function ($m) {
$m->purchaseInvoice()->updateTransaction();
});
}
}
示例13: init
function init()
{
parent::init();
$task = $this->add('xepan\\projects\\Model_Task');
$task->addCondition($task->dsql()->orExpr()->where('assign_to_id', $this->app->employee->id)->where('created_by_id', $this->app->employee->id));
$task->addCondition('status', 'not in', ['Assigned', 'Completed']);
$form = $this->add('Form')->addClass('main-box');
$col = $form->add('Columns');
$col1 = $col->addColumn(6)->addClass('col-md-6')->setStyle('height', '80px');
$col2 = $col->addColumn(3)->addClass('col-md-3')->setStyle('height', '80px');
$col3 = $col->addColumn(3)->addClass('col-md-3')->setStyle('height', '80px');
$task_field = $col1->addField('xepan\\base\\DropDown', 'task');
$task_field->setEmptyText('Please select a task or add new by typing');
$task_field->setModel($task);
$task_field->validate_values = false;
$task_field->select_menu_options = ['tags' => true];
$starttime_field = $col2->addField('TimePicker', 'starttime');
$endtime_field = $col3->addField('TimePicker', 'endtime');
$starttime_field->setOption('showMeridian', false)->setOption('minuteStep', 1)->setOption('showSeconds', true);
$endtime_field->setOption('showMeridian', false)->setOption('minuteStep', 1)->setOption('showSeconds', true);
$form->addSubmit('Save')->addClass('btn btn-primary')->setStyle('text-align', 'center');
$timesheet_m = $this->add('xepan\\projects\\Model_Timesheet');
$timesheet_m->addCondition('employee_id', $this->app->employee->id);
$timesheet_m->addCondition('starttime', '>=', $this->app->today);
$timesheet_m->acl = 'xepan\\projects\\Model_Task';
$timesheet_m->setOrder('starttime', 'asc');
$grid = $this->add('xepan\\hr\\CRUD');
$grid->setModel($timesheet_m, ['task', 'starttime', 'endtime', 'duration']);
$grid->grid->removeColumn('action');
$grid->grid->removeColumn('attachment_icon');
if ($form->isSubmitted()) {
$timestamp = $this->app->today;
$timestamp .= ' ' . $form['starttime'];
$starting_time = date('Y-m-d H:i:s', strtotime($timestamp));
$timestamp = $this->app->today;
$timestamp .= ' ' . $form['endtime'];
$ending_time = date('Y-m-d H:i:s', strtotime($timestamp));
$model_task = $this->add('xepan\\projects\\Model_Task');
$model_task->addCondition($model_task->dsql()->orExpr()->where('assign_to_id', $this->app->employee->id)->where('created_by_id', $this->app->employee->id));
$model_task->tryLoadBy('id', $form['task']);
if (!$model_task->loaded()) {
if (!$form['task']) {
$form->displayError('task', 'Add a new task or select from old');
}
$model_task['task_name'] = $form['task'];
$model_task['assign_to_id'] = $this->app->employee->id;
$model_task['created_by_id'] = $this->app->employee->id;
$model_task['status'] = 'Pending';
$model_task['created_at'] = $this->app->now;
$model_task->save();
}
$model_timesheet = $this->add('xepan\\projects\\Model_Timesheet');
$model_timesheet['employee_id'] = $this->app->employee->id;
$model_timesheet['task_id'] = $model_task->id;
$model_timesheet['starttime'] = $starting_time;
$model_timesheet['endtime'] = $ending_time;
$model_timesheet->save();
$form->js('true', $grid->js()->reload())->univ()->successMessage('Saved')->execute();
}
}
示例14: init
function init()
{
parent::init();
$tabs = $this->add('Tabs');
$permitted_dashboards = $tabs->addTab('Permitted Dashboards');
$default_permitted_list = [];
switch ($this->app->employee->ref('post_id')->get('permission_level')) {
case 'Global':
$default_permitted_list = ['Global', 'Sibling', 'Department', 'Individual'];
break;
case 'Sibling':
$default_permitted_list = ['Sibling', 'Department', 'Individual'];
break;
case 'Department':
$default_permitted_list = ['Department', 'Individual'];
break;
default:
$default_permitted_list = ['Individual'];
}
$permitted_reports_model = $this->add('xepan\\base\\Model_GraphicalReport');
$permitted_reports_model->addCondition([['name', 'in', $default_permitted_list], ['permitted_post', 'like', '%"' . $this->app->employee['post_id'] . '"%'], ['created_by_id', $this->app->employee->id]]);
$form = $permitted_dashboards->add('Form');
$form->addField('DropDown', 'permitted_dashboards')->setModel($permitted_reports_model);
$form->addSubmit('Save')->addClass('btn btn-primary');
if ($form->isSubmitted()) {
$employee_m = $this->add('xepan\\hr\\Model_Employee');
$employee_m->load($this->app->employee->id);
$employee_m['graphical_report_id'] = $form[''];
}
}
示例15: render
function render()
{
// $this->js(true)->_load('masonry.pkgd.min')->masonry(['itemSelector'=>'.widget'])->_selector('.widget-grid');
$this->app->js('chart_rendered', 'console.log(123)');
//->masonry(['itemSelector'=>'.widget'])->_selector('.widget-grid');
return parent::render();
}