本文整理汇总了PHP中NavigationControl类的典型用法代码示例。如果您正苦于以下问题:PHP NavigationControl类的具体用法?PHP NavigationControl怎么用?PHP NavigationControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NavigationControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eventActivatePlugin
/**
* event function to activate a plugin from setting page
* @param object $evctl
*/
public function eventActivatePlugin(EventControler $evctl)
{
$permission = $_SESSION["do_user"]->is_admin == 1 ? true : false;
if (true === $permission) {
if (trim($evctl->plugin_name) != '') {
if (false === $this->get_plugin_by_name($evctl->plugin_name)) {
$this->addNew();
$this->name = trim($evctl->plugin_name);
$this->add();
$plugin_id = $this->getInsertId();
$this->do_sorting_on_activate(trim($evctl->plugin_name));
echo $plugin_id;
}
}
} else {
$_SESSION["do_crm_messages"]->set_message('error', _('You do not have permission to delete record !'));
$next_page = NavigationControl::getNavigationLink("Settings", "plugins");
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
}
}
示例2: eventUpdateModuleDataShareRel
/**
* function to update the datashare permission across the module
* @param object $evctl
*/
public function eventUpdateModuleDataShareRel(EventControler $evctl)
{
$permission = $_SESSION["do_user"]->is_admin == 1 ? true : false;
if (true === $permission) {
$qry = "select idmodule_datashare_rel,idmodule from `" . $this->getTable() . "`";
$stmt = $this->getDbConnection()->executeQuery($qry);
while ($data = $stmt->fetch()) {
$datashare_permission_form_name = 'mod_' . $data["idmodule"];
$permission_flag = $evctl->{$datashare_permission_form_name};
$this->cleanValues();
$this->permission_flag = $permission_flag;
$this->update($data["idmodule_datashare_rel"]);
}
$dis = new Display($evctl->next_page);
$evctl->setDisplayNext($dis);
} else {
$_SESSION["do_crm_messages"]->set_message('error', _('You do not have permission to add record ! '));
$next_page = NavigationControl::getNavigationLink("Settings", "index");
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
}
}
示例3: eventEditComboValues
/**
* function to edit the combo values
* @param object $evctl
*/
public function eventEditComboValues(EventControler $evctl)
{
$idfields = (int) $evctl->idfields;
if ($idfields > 0) {
$referrar_module_id = (int) $evctl->referrar_module_id;
$pick_values_seperated = preg_split('/[\\r\\n]+/', $evctl->pick_values, -1, PREG_SPLIT_NO_EMPTY);
$this->update_combo_values($idfields, $pick_values_seperated);
//check if the field is mapped with some other fields and if yes then update the mapped fields also
$do_crm_fields_mapping = new CRMFieldsMapping();
$mapped_fields = $do_crm_fields_mapping->is_mapped($idfields);
if (is_array($mapped_fields) && count($mapped_fields) > 0) {
foreach ($mapped_fields as $mapped_fieldid) {
$this->update_combo_values($mapped_fieldid, $pick_values_seperated);
}
}
$_SESSION["do_crm_messages"]->set_message('success', _('Data has been updated successfully.'));
$next_page = NavigationControl::getNavigationLink("Settings", "picklist");
$dis = new Display($next_page);
$dis->addParam("cmid", $referrar_module_id);
$evctl->setDisplayNext($dis);
}
}
示例4: eventAjaxLoadRecentlyViewed
/**
* event function to load the recently viewed infomation
* @param object $evctl
* @return string html
*/
function eventAjaxLoadRecentlyViewed(EventControler $evctl)
{
$html = '';
$iduser = $_SESSION["do_user"]->iduser;
$this->get_recently_viewed($iduser);
if ($this->getNumRows() > 0) {
$do_crm_entity = new CRMEntity();
$html .= '<ul id="recently_viewed">
<li><a href="" class="current">' . _('Recently Viewed') . '</a></li>
';
while ($this->next()) {
$identifier = '';
$record_url = '';
$module = $_SESSION["do_module"]->modules_full_details[$this->idmodule]["name"];
$identifier = $do_crm_entity->get_entity_identifier($this->idrecord, $module);
$record_url = NavigationControl::getNavigationLink($module, "detail", $this->idrecord);
$html .= '<li><a href="' . $record_url . '">' . $identifier . '</a></li>';
}
$html .= '</ul>';
}
echo $html;
}
示例5: Roles
$do_roles = new Roles();
?>
<div class="container-fluid">
<div class="row">
<?php
include_once "modules/Settings/settings_leftmenu.php";
?>
<div class="col-md-9">
<div class="box_content">
<ol class="breadcrumb">
<li class="active"><?php
echo _('Settings');
?>
</li>
<li><a href="<?php
echo NavigationControl::getNavigationLink($module, "roles_list");
?>
"><?php
echo _('Roles');
?>
</a></li>
</ol>
<p class="lead"><?php
echo _('Manage Roles hierarchy for users');
?>
</p>
</div>
<div class="datadisplay-outer">
<h2><small class="text-muted"><?php
echo _('Tree view of roles and hierarchy');
?>
示例6: SalesOrder
$inv_terms_cond = $do_global_settings->get_inventory_terms_condition();
$tems_condition = $inv_terms_cond["salesorder_terms_condition"];
$module_obj = new SalesOrder();
$module_obj->getId($sqcrm_record_id);
$do_lineitems = new Lineitems();
$do_lineitems->get_line_items($module_id, $sqcrm_record_id);
$do_products = new Products();
$lineitems = array();
if ($do_lineitems->getNumRows() > 0) {
while ($do_lineitems->next()) {
$product_available_tax = '';
if ($do_lineitems->item_type == 'product') {
$product_available_tax = $do_products->get_products_tax($do_lineitems->item_value);
}
$lineitems[] = array("idlineitems" => $do_lineitems->idlineitems, "item_type" => $do_lineitems->item_type, "item_name" => $do_lineitems->item_name, "item_value" => $do_lineitems->item_value, "item_description" => $do_lineitems->item_description, "item_quantity" => $do_lineitems->item_quantity, "item_price" => $do_lineitems->item_price, "discount_type" => $do_lineitems->discount_type, "discount_value" => $do_lineitems->discount_value, "discounted_amount" => $do_lineitems->discounted_amount, "tax_values" => $do_lineitems->tax_values, "product_available_tax" => $product_available_tax, "taxed_amount" => $do_lineitems->taxed_amount, "total_after_discount" => $do_lineitems->total_after_discount, "total_after_tax" => $do_lineitems->total_after_tax, "net_total" => $do_lineitems->net_total);
}
}
//print_r($lineitems);
if (isset($_GET["return_page"]) && $_GET["return_page"] != '') {
$return = $_GET["return_page"];
$cancel_return = NavigationControl::getNavigationLink($module, $return, $sqcrm_record_id);
} else {
$cancel_return = NavigationControl::getNavigationLink($module, "list");
}
//Assigned to iduser or group ?
if ($module_obj->iduser > 0) {
$assigned_to = 'user_' . $module_obj->iduser;
} elseif ($module_obj->idgroup > 0) {
$assigned_to = 'group_' . $module_obj->idgroup;
}
require_once 'view/edit_view.php';
示例7: eventEditRecord
/**
* Event function to update the organization data
* @param object $evctl
*/
public function eventEditRecord(EventControler $evctl)
{
$id_entity = (int) $evctl->sqrecord;
if ($id_entity > 0 && true === $_SESSION["do_crm_action_permission"]->action_permitted('edit', 11, (int) $evctl->sqrecord)) {
$obj = $this->getId($id_entity);
$obj = (object) $obj;
// convert the data array to Object
$do_process_plugins = new CRMPluginProcessor();
// process before update plugin. If any error is raised display that.
$do_process_plugins->process_action_plugins((int) $evctl->idmodule, $evctl, 3, $id_entity, $obj);
if (strlen($do_process_plugins->get_error()) > 2) {
$_SESSION["do_crm_messages"]->set_message('error', $do_process_plugins->get_error());
$next_page = NavigationControl::getNavigationLink($evctl->module, "edit");
$dis = new Display($next_page);
$dis->addParam("sqrecord", $id_entity);
if ($evctl->return_page != '') {
$dis->addParam("return_page", $evctl->return_page);
}
$evctl->setDisplayNext($dis);
} else {
$do_crm_fields = new CRMFields();
$crm_fields = $do_crm_fields->get_field_information_by_module_as_array((int) $evctl->idmodule);
$table_entity = 'vendor';
$table_entity_address = 'vendor_address';
$table_entity_custom = 'vendor_custom_fld';
$table_entity_to_grp = 'vendor_to_grp_rel';
$entity_data_array = array();
$custom_data_array = array();
$addr_data_array = array();
$assigned_to_as_group = false;
foreach ($crm_fields as $crm_fields) {
$field_name = $crm_fields["field_name"];
$field_value = $do_crm_fields->convert_field_value_onsave($crm_fields, $evctl, 'edit');
if (is_array($field_value) && count($field_value) > 0) {
if ($field_value["field_type"] == 15) {
$field_name = 'iduser';
$value = $field_value["value"];
$assigned_to_as_group = $field_value["assigned_to_as_group"];
$group_id = $field_value["group_id"];
} elseif ($field_value["field_type"] == 12) {
$value = $field_value["name"];
$avatar_array[] = $field_value;
}
} else {
$value = $field_value;
}
if ($crm_fields["table_name"] == $table_entity && $crm_fields["idblock"] > 0) {
$entity_data_array[$field_name] = $value;
}
if ($crm_fields["table_name"] == $table_entity_address && $crm_fields["idblock"] > 0) {
$addr_data_array[$field_name] = $value;
}
if ($crm_fields["table_name"] == $table_entity_custom && $crm_fields["idblock"] > 0) {
$custom_data_array[$field_name] = $value;
}
}
$this->update(array($this->primary_key => $id_entity), $table_entity, $entity_data_array);
//updating the last_modified,last_modified_by
$q_upd = "\n\t\t\t\tupdate `" . $this->getTable() . "` set \n\t\t\t\t`last_modified` = ? ,\n\t\t\t\t`last_modified_by` = ? \n\t\t\t\twhere `" . $this->primary_key . "` = ?";
$this->query($q_upd, array(date("Y-m-d H:i:s"), $_SESSION["do_user"]->iduser, $id_entity));
if (count($custom_data_array) > 0) {
$this->update(array($this->primary_key => $id_entity), $table_entity_custom, $custom_data_array);
}
if (count($addr_data_array) > 0) {
$this->update(array($this->primary_key => $id_entity), $table_entity_address, $addr_data_array);
}
if ($assigned_to_as_group === false) {
$qry_grp_rel = "DELETE from `{$table_entity_to_grp}` where idvendor = ? LIMIT 1";
$this->query($qry_grp_rel, array($id_entity));
} else {
$qry_grp_rel = "select * from `{$table_entity_to_grp}` where idvendor = ?";
$this->query($qry_grp_rel, array($id_entity));
if ($this->getNumRows() > 0) {
$this->next();
$id_grp_rel = $this->idvendor_to_grp_rel;
$q_upd = "\n\t\t\t\t\t\tupdate `{$table_entity_to_grp}` set \n\t\t\t\t\t\t`idgroup` = ?\n\t\t\t\t\t\twhere `idvendor_to_grp_rel` = ? LIMIT 1";
$this->query($q_upd, array($group_id, $id_grp_rel));
} else {
$this->insert($table_entity_to_grp, array("idvendor" => $id_entity, "idgroup" => $group_id));
}
}
// Record the history
$do_data_history = new DataHistory();
$do_data_history->add_history($id_entity, (int) $evctl->idmodule, 'edit');
$do_data_history->add_history_value_changes($id_entity, (int) $evctl->idmodule, $obj, $evctl);
//record the feed
$feed_other_assigne = array();
if ($assigned_to_as_group === true) {
$feed_other_assigne = array("related" => "group", "data" => array("key" => "newgroup", "val" => $group_id));
}
$do_feed_queue = new LiveFeedQueue();
$do_feed_queue->add_feed_queue($id_entity, (int) $evctl->idmodule, $evctl->vendor_name, 'edit', $feed_other_assigne);
// process after update plugin
$do_process_plugins->process_action_plugins((int) $evctl->idmodule, $evctl, 4, $id_entity, $obj);
$_SESSION["do_crm_messages"]->set_message('success', _('Data updated successfully !'));
$next_page = NavigationControl::getNavigationLink($evctl->module, "detail");
//.........这里部分代码省略.........
示例8: eventActivateCpanelLogin
/**
* event function to activate the cpanel login
* @param object $evctl
* @return void
*/
function eventActivateCpanelLogin(EventControler $evctl)
{
if ((int) $evctl->record_id > 0) {
$this->getId((int) $evctl->record_id);
$err = '';
if ((int) $this->idorganization == 0) {
$err = _('Contact must be associated with an organization for portal login activation');
}
if (strlen(trim($this->email)) == 0) {
$err = _('Missing the primary email id for portal login activation');
}
} else {
$err = _('Missing idcontacts for portal activation');
}
if (strlen($err) == 0) {
$pass = $this->activate_cpanel_login((int) $evctl->record_id, $this->email, (int) $this->idorganization);
$contact_data = array("firstname" => $this->firstname, "lastname" => $this->lastname, "email" => $this->email, "password" => $pass);
$this->send_cpanel_login_details($contact_data);
$_SESSION["do_crm_messages"]->set_message('success', _('Portal user is created and email sent with the details ! '));
$next_page = NavigationControl::getNavigationLink('Contacts', "detail");
$dis = new Display($next_page);
$dis->addParam("sqrecord", $evctl->record_id);
$evctl->setDisplayNext($dis);
} else {
$_SESSION["do_crm_messages"]->set_message('error', $err);
$next_page = NavigationControl::getNavigationLink('Contacts', "detail");
$dis = new Display($next_page);
$dis->addParam("sqrecord", $evctl->record_id);
$evctl->setDisplayNext($dis);
}
}
示例9: display_value
/**
* Static function to display the data in detail view
* @param string $value
* @param string $cont_name
* @param boolean $linked
*/
public static function display_value($value, $cont_name = '', $linked = true)
{
if ($cont_name != '') {
if ($linked === true) {
return '<a href="' . NavigationControl::getNavigationLink('Contacts', "detail", $value) . '">' . $cont_name . '</a>';
} else {
return $cont_name;
}
} else {
$display_val = self::get_value($value);
if ($display_val == '') {
return $display_val;
} else {
if ($linked === true) {
return '<a href="' . NavigationControl::getNavigationLink('Contacts', "detail", $value) . '">' . $display_val . '</a>';
} else {
return $display_val;
}
}
}
}
示例10: Event
*/
?>
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="datadisplay-outer">
<?php
$e_edit_entity = new Event($module."->eventEditRecord");
$e_edit_entity->addParam("idmodule",$module_id);
$e_edit_entity->addParam("module",$module);
$e_edit_entity->addParam("sqrecord",$sqcrm_record_id);
if (isset($_REQUEST["return_page"]) && strlen($_REQUEST["return_page"]) > 2) {
$e_edit_entity->addParam("return_page",$_REQUEST["return_page"]);
}
$e_edit_entity->addParam("error_page",NavigationControl::getNavigationLink($module,"edit",$sqcrm_record_id));
echo '<form class="form-horizontal" id="'.$module.'__editRecord" name="'.$module.'__editRecord" action="/eventcontroler.php" method="post" enctype="multipart/form-data">';
echo $e_edit_entity->getFormEvent();
require("edit_view_form_fields.php");
?>
</form>
</div>
</div><!--/row-->
</div><!--/span-->
</div><!--/row-->
</div>
<script>
<?php
echo $do_crmfields->get_js_form_validation($module_id,$module."__editRecord","edit");
?>
$.validator.addMethod("notEqual", function(value,element,param) {
示例11: eventDiscardImport
/**
* Event function to discard the last import
* will set the deleted = 0 for the last imported data for the module
* @param object $evctl
*/
public function eventDiscardImport(EventControler $evctl)
{
$import_module_id = $this->get_import_module_id();
switch ($import_module_id) {
case 3:
$import_object = new LeadsImport();
break;
case 4:
$import_object = new ContactsImport();
break;
case 5:
$import_object = new PotentialsImport();
break;
case 6:
$import_object = new OrganizationImport();
break;
case 11:
$import_object = new VendorImport();
break;
case 12:
$import_object = new ProductsImport();
break;
}
$qry = "\n\t\tselect * from " . $this->getTable() . " \n\t\twhere \n\t\t`idmodule` = " . $import_module_id . " \n\t\tAND `iduser` = " . $_SESSION["do_user"]->iduser;
$stmt = $this->getDbConnection()->executeQuery($qry, array("idmodule" => $import_module_id, "iduser" => $_SESSION["do_user"]->iduser));
if ($stmt->rowCount() > 0) {
while ($data = $stmt->fetch()) {
$qry = "\n\t\t\t\tupdate " . $import_object->getTable() . " \n\t\t\t\tset `deleted` = 1\n\t\t\t\twhere `" . $import_object->primary_key . "` = ?\n\t\t\t\tAND `iduser` = ? limit 1 ";
$import_object->query($qry, array($data["idrecord"], $data["iduser"]));
}
}
$this->clean_previous_imports();
$next_page = NavigationControl::getNavigationLink("Import", "index");
$dis = new Display($next_page);
$dis->addParam("return_module", $this->get_import_module_id());
$evctl->setDisplayNext($dis);
}
示例12: _
echo '<span style="font-size: 11px;">' . _('and') . '</span>';
}
?>
</td>
</tr>
<tr><td></td></tr>
<tr><td></td></tr>
<?php
}
?>
</table>
</div>
<hr class="form_hr">
<div class="left_600">
<a href="<?php
echo NavigationControl::getNavigationLink($_SESSION["do_module"]->modules_full_details[$module_obj->idmodule]["name"], "list");
?>
" class="btn btn-inverse">
<i class="icon-white icon-remove-sign"></i> <?php
echo _('Cancel');
?>
</a>
<input type="submit" class="btn btn-primary" value="<?php
echo _('Save');
?>
"/>
</div>
</div>
</div>
</div>
<script>
示例13: elseif
</a>
</li>
</ul>
<?php } elseif ($module_id == 11) { ?>
<ul class="list-group">
<li class="list-group-item">
<a href="<?php echo NavigationControl::getNavigationLink("Vendor","create_purchase_order",$sqcrm_record_id,'&return_page=detail'); ?>" onclick = "">
<img src="/themes/images/purchase_order.png" style="vertical-align:center;">
<?php echo _('create purchase order');?>
</a>
</li>
</ul>
<?php } elseif ($module_id == 12) { ?>
<ul class="list-group">
<li class="list-group-item">
<a href="<?php echo NavigationControl::getNavigationLink("Products","create_purchase_order",$sqcrm_record_id,'&return_page=detail'); ?>" onclick = "">
<img src="/themes/images/purchase_order.png" style="vertical-align:center;">
<?php echo _('create purchase order');?>
</a>
</li>
</ul>
<?php } ?>
<?php
$do_queue = new Queue() ;
if (true === $do_queue->queue_permitted_for_module($module_id)) {
echo '<div id="queue_section" style="margin-left:16px;">' ;
echo '</div>' ;
}
?>
</div>
<?php
示例14: createComponentNavigation
protected function createComponentNavigation($name)
{
$nav = new NavigationControl($this, $name);
$menuItems = dibi::select("id, label_{$this->lang} AS label, nette_link, nette_link_args, current_link, uri")->from('menu')->where('is_visible = 1')->orderBy('sort')->fetchAll();
foreach ($menuItems as $item) {
$args = !is_null($item->nette_link_args) ? Basic::string2array(str_replace('%id%', $item->id, $item->nette_link_args)) : array();
// expand nette link args
$uri = $item->nette_link !== null ? $this->link($item->nette_link, $args) : $item->uri;
// nette link or standard URI
$nav->add($item->label, $uri, $item->current_link);
}
}
示例15: get_data_history_display_text
/**
* function to get data history display text
* @param object $obj
* @param boolean $link
* @param boolean $user_history
* @return array $ret_array
*/
public function get_data_history_display_text($obj, $link = false, $user_history = false)
{
$row1 = '<strong>' . $obj->firstname . ' ' . $obj->lastname . '</strong> ' . _('on ') . '<i>' . i18nDate::i18n_long_time(TimeZoneUtil::convert_to_user_timezone($obj->date_modified, true)) . '</i>';
switch ($obj->action) {
case 'add':
if ($user_history === true) {
$row2 = _('Added') . ' ' . CommonUtils::get_module_name_as_text($obj->idmodule);
} else {
$row2 = _('Added the record');
}
break;
case 'delete':
if ($user_history === true) {
$row2 = _('Deleted') . ' ' . CommonUtils::get_module_name_as_text($obj->idmodule);
} else {
$row2 = _('Deleted the record');
}
break;
case 'edit':
if ($user_history === true) {
$row2 = _('Updated') . ' ' . CommonUtils::get_module_name_as_text($obj->idmodule);
} else {
$row2 = _('Updated the record');
}
break;
case 'value_changes':
$do_crm_fields = new CRMFields();
$do_crm_fields->getId($obj->idfields);
if ($do_crm_fields->getNumRows() > 0) {
$field_label = $do_crm_fields->field_label;
$old_value = $obj->old_value;
$new_value = $obj->new_value;
if ($do_crm_fields->field_type == 9) {
$old_value = FieldType9::display_value($old_value);
$new_value = FieldType9::display_value($new_value);
}
if ($user_history === true) {
$row2 = _('Changed value in') . ' ' . CommonUtils::get_module_name_as_text($obj->idmodule) . ' , ' . $field_label . ' :: ' . $old_value . ' >>> ' . $new_value;
} else {
$row2 = _('Changed') . ' ' . $field_label . ' :: ' . $old_value . ' >>> ' . $new_value;
}
}
$do_crm_fields->free();
break;
}
if ($obj->user_avatar != '') {
$avatar_path = $GLOBALS['AVATAR_DISPLAY_PATH'];
$thumb = $avatar_path . '/ths_' . $obj->user_avatar . '.' . $obj->file_extension;
}
if ($link === true) {
$detail_url = NavigationControl::getNavigationLink($_SESSION["do_module"]->modules_full_details[$obj->idmodule]["name"], "detail", $obj->id_referrer);
$row2 .= ' <a href="' . $GLOBALS['SITE_URL'] . $detail_url . '">' . $GLOBALS['SITE_URL'] . $detail_url . '</a>';
}
$ret_array = array("avatar" => $thumb, "row1" => $row1, "row2" => $row2);
return $ret_array;
}