本文整理汇总了PHP中Display::addParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Display::addParam方法的具体用法?PHP Display::addParam怎么用?PHP Display::addParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::addParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eventShareContactsMultiple
/**
* Event method sharing the contacts with the Co-Workers
* @param object $evtcl
*/
function eventShareContactsMultiple(EventControler $evtcl)
{
$contacts = $evtcl->getParam("idcontacts");
$co_workers = $evtcl->getParam("cwid");
$count = 0;
$no_coworker = 0;
if (is_array($contacts) && is_array($co_workers)) {
$do_tag = new Tag();
foreach ($co_workers as $co) {
foreach ($contacts as $cont) {
if (!$this->checkCoWorkerContactRel($cont, $co)) {
$this->addContactSharings($cont, $co);
$do_tag->addTagOnContactSharing($cont, $co);
$count++;
}
}
}
}
if ($count) {
$msg = 'Sharing Updated succesfully';
} else {
$msg = 'No Data updated,you may be trying to duplicate some contact access';
}
$goto = $evtcl->goto;
$dispError = new Display($goto);
$dispError->addParam("message", $msg);
$evtcl->setDisplayNext($dispError);
}
示例2: eventVCardImport
function eventVCardImport(EventControler $evtcl)
{
$msg = "";
$goto = $evtcl->getParam("goto");
$uploaded_file = $_FILES['fields']['name']['contact_vcard'];
if ($uploaded_file) {
$target_path = 'files/' . $uploaded_file;
if (!move_uploaded_file($_FILES['fields']['tmp_name']['contact_vcard'], $target_path)) {
$msg = "There was an error uploading the file, please try again!";
} else {
chmod($target_path, 0755);
$_SESSION['vcard_file'] = $uploaded_file;
$_SESSION['import_tag'] = trim($evtcl->fields['import_tag']);
$retVal = $this->print_vcard_address_book($target_path, 'ofuz vCard Import', '', '', '');
if ($retVal) {
$msg = "Your vCard contacts have been imported successfully.";
} else {
$msg = $this->errMsg;
}
}
} else {
$msg = "Please select a file to be imported.";
}
$disp = new Display($goto);
$disp->addParam("msg", $msg);
if ($evtcl->getParam("fromReg") == 'Yes') {
//if importing while registration
$_SESSION["page_from"] = 'reg';
}
$evtcl->setDisplayNext($disp);
}
示例3: eventChangeGoto
function eventChangeGoto(Eventcontroler $evtcl)
{
$fields = $evtcl->fields;
$dispError = new Display("settings_auto_responder_email.php");
$dispError->addParam("id", $fields["idautoresponder"]);
$evtcl->setDisplayNext($dispError);
}
示例4: eventEditGroup
/**
* Event function to update the group
* Also updates the related member information of the group
* @param object $evctl
* @see modules/Settings/group_edit.php
*/
public function eventEditGroup(EventControler $evctl)
{
$permission = $_SESSION["do_user"]->is_admin == 1 ? true : false;
if (true === $permission) {
if ($evctl->idgroup != '' && $evctl->group_name) {
$qry = "\n\t\t\t\tUPDATE `" . $this->getTable() . "` \n\t\t\t\tset `group_name` = ?,\n\t\t\t\t`description` = ?\n\t\t\t\twhere `idgroup` = ? LIMIT 1";
$this->query($qry, array(CommonUtils::purify_input($evctl->group_name), CommonUtils::purify_input($evctl->description), $evctl->idgroup));
if (is_array($evctl->select_to) && count($evctl->select_to) > 0) {
$do_group_user_rel = new GroupUserRelation();
$do_group_user_rel->update_group_related_to_user($evctl->select_to, $evctl->idgroup);
}
$_SESSION["do_crm_messages"]->set_message('success', _('Group has been updated successfully !'));
$dis = new Display($evctl->next_page);
$dis->addParam("sqrecord", $evctl->idgroup);
$evctl->setDisplayNext($dis);
} else {
$_SESSION["do_crm_messages"]->set_message('error', _('Unable to update the group, either group name or id is missing !'));
$dis = new Display($evctl->error_page);
$evctl->setDisplayNext($dis);
}
} else {
$_SESSION["do_crm_messages"]->set_message('error', _('You do not have permission to edit record !'));
$next_page = NavigationControl::getNavigationLink("Settings", "index");
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
}
}
示例5: eventCheckEmptyFields
function eventCheckEmptyFields(Eventcontroler $evtcl)
{
$field_selected = $evtcl->field_selected;
if (empty($field_selected)) {
$_SESSION['in_page_message'] = _("Please select some labels");
$evtcl->doSave = 'no';
$evtcl->goto = 'settings_wf.php';
$dispError = new Display("settings_wf.php");
$dispError->addParam("e", 'yes');
$evtcl->setDisplayNext($dispError);
}
}
示例6: eventAddRecord
/**
* event function to add a custom view
* @param object $evctl
* @return void
*/
public function eventAddRecord(EventControler $evctl)
{
if (trim($evctl->cvname) == '') {
$_SESSION["do_crm_messages"]->set_message('error', _('Please add a custom view name before saving !'));
$next_page = NavigationControl::getNavigationLink("CustomView", "add");
$dis = new Display($next_page);
$dis->addParam("target_module_id", (int) $evctl->target_module_id);
$evctl->setDisplayNext($dis);
} elseif ((int) $evctl->target_module_id == 0) {
$_SESSION["do_crm_messages"]->set_message('error', _('Missing target module for custom view !'));
$next_page = NavigationControl::getNavigationLink("CustomView", "add");
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
} elseif (false === $_SESSION["do_crm_action_permission"]->action_permitted('add', 17)) {
$_SESSION["do_crm_messages"]->set_message('error', _('You do not have permission to add record !'));
$next_page = NavigationControl::getNavigationLink($_SESSION["do_module"]->modules_full_details[$evctl->target_module_id]["name"], "list");
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
} else {
$this->addNew();
$this->name = $evctl->cvname;
$this->iduser = $_SESSION["do_user"]->iduser;
$this->is_default = $evctl->is_default == 'on' ? 1 : 0;
if ($_SESSION["do_user"]->is_admin == 1) {
$this->is_public = $evctl->is_public == 'on' ? 1 : 0;
}
$this->idmodule = (int) $evctl->target_module_id;
$this->is_editable = 1;
$this->add();
$idcustom_view = $this->getInsertId();
//reset default custom view if is_default is set
if ($evctl->is_default == 'on') {
$this->reset_default_custom_view($idcustom_view, $evctl->target_module_id);
}
//add custom view fields
$do_custom_view_fields = new CustomViewFields();
$do_custom_view_fields->add_custom_view_fields($idcustom_view, $evctl->cv_fields);
//add custom view filter
$do_custom_view_filter = new CustomViewFilter();
$do_custom_view_filter->add_custom_view_date_filter($idcustom_view, $evctl->cv_date_field, $evctl->cv_date_field_type, $evctl->cv_date_start, $evctl->cv_date_end);
//add advanced filter
$adv_filter_data = array("cv_adv_fields_1" => $evctl->cv_adv_fields_1, "cv_adv_fields_type_1" => $evctl->cv_adv_fields_type_1, "cv_adv_fields_val_1" => $_POST["cv_adv_fields_val_1"], "cv_adv_fields_2" => $evctl->cv_adv_fields_2, "cv_adv_fields_type_2" => $evctl->cv_adv_fields_type_2, "cv_adv_fields_val_2" => $_POST["cv_adv_fields_val_2"], "cv_adv_fields_3" => $evctl->cv_adv_fields_3, "cv_adv_fields_type_3" => $evctl->cv_adv_fields_type_3, "cv_adv_fields_val_3" => $_POST["cv_adv_fields_val_3"], "cv_adv_fields_4" => $evctl->cv_adv_fields_4, "cv_adv_fields_type_4" => $evctl->cv_adv_fields_type_4, "cv_adv_fields_val_4" => $_POST["cv_adv_fields_val_4"], "cv_adv_fields_5" => $evctl->cv_adv_fields_5, "cv_adv_fields_type_5" => $evctl->cv_adv_fields_type_5, "cv_adv_fields_val_5" => $_POST["cv_adv_fields_val_5"]);
$do_custom_view_filter->add_custom_view_adv_filter($idcustom_view, $adv_filter_data);
//redirect after adding the custom view
$next_page = NavigationControl::getNavigationLink($_SESSION["do_module"]->modules_full_details[$evctl->target_module_id]["name"], "list", '', '&custom_view_id=' . $idcustom_view);
$dis = new Display($next_page);
$evctl->setDisplayNext($dis);
}
}
示例7: eventCheckEmptyFields
function eventCheckEmptyFields(Eventcontroler $evtcl)
{
$fields = $evtcl->fields;
if ($fields['name'] == '') {
$evtcl->doSave = 'no';
$_SESSION['in_page_message'] = _("Please provide one name for the autoresponder");
} elseif ($fields['tag_name'] == '') {
$evtcl->doSave = 'no';
$_SESSION['in_page_message'] = _("Please Select One Tag");
}
if ($evtcl->doSave == 'no') {
$evtcl->goto = 'settings_auto_responder.php';
$dispError = new Display("settings_auto_responder.php");
$dispError->addParam("e", 'yes');
$evtcl->setDisplayNext($dispError);
}
}
示例8: eventCheckDuplicateCompanyInUpdate
/**
* Event Function used while updating a company
* Checks if the updated Company is already in the database
* If there then do not update and set doSave = mo
* Else continue with other events from the called page
*
*/
function eventCheckDuplicateCompanyInUpdate(EventControler $evtcl)
{
$fields = $evtcl->getParam('fields');
$q_company = new sqlQuery($this->getDbCon());
$q_company->query("select name from company where idcompany = " . $this->getPrimaryKeyValue());
$q_company->fetch();
$comp_name = $q_company->getData("name");
$q = new sqlQuery($this->getDbCon());
$q->query("select * from company where name='" . trim($fields['name']) . "' \r\n AND name <> '" . trim($comp_name) . "'");
// need to have the iduser as well
if ($q->getNumRows() > 0) {
$dispError = new Display($evtcl->goto);
$dispError->addParam("message", "This company is already in the database");
$evtcl->addParam("doSave", "no");
$evtcl->setDisplayNext($dispError);
}
}
示例9: eventCancelAccount
function eventCancelAccount(EventControler $evtcl)
{
//echo 'No cancellation after registration....';
//echo '<br /> and for the reson that u have given <br />'.$evtcl->fields["reason"].'<br /> no way, no cancellation ';
//exit;
if ($evtcl->fields["reason"] != '') {
$this->deleteContactRelated();
$this->deleteUserContactNote();
$this->deleteUserContactSharing();
$this->deleteUserEmailTemplate();
$this->deleteInvoiceRelated();
$this->deleteMessage();
$this->deleteProjectRelated();
$this->deleteTask();
$this->deletewebformuser();
$this->deleteworkfeed();
$this->deletenotedraft();
$this->deletetwitteraccount();
$this->deletetbreadcrumb();
$this->deleteUserRel();
$this->deleteUserSettings();
$this->deleteUserTags();
$this->dropContactView();
$email_template = new EmailTemplate("ofuz_cancel_account_notification");
$email_template->setSenderName($_SESSION['do_User']->getFullName());
$email_template->setSenderEmail($_SESSION['do_User']->email);
$email_data = array('name' => $_SESSION['do_User']->getFullName(), 'email' => $_SESSION['do_User']->email, 'reason' => $evtcl->fields["reason"]);
$emailer = new Radria_Emailer();
$emailer->setEmailTemplate($email_template);
$emailer->mergeArray($email_data);
$emailer->addTo("philippe@sqlfusion.com");
//$emailer->addTo("abhik@sqlfusion.com");
$emailer->send();
$this->deleteUser();
} else {
$_SESSION['in_page_message'] = _("Please Provide a reason before cancelling the account");
$dispError = new Display('cancel_account.php');
$dispError->addParam("m", 'e');
$evtcl->setDisplayNext($dispError);
}
}
示例10: 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);
}
}
示例11: eventLogin
/**
* event function for cpanel login
* @param object $evctl
* @return void
*/
public function eventLogin(\EventControler $evctl)
{
$login_success = false;
if ($evctl->user_name != '' && $evctl->user_password != '') {
$qry = "\n\t\t\tselect cu.*,c.firstname,c.lastname,c.contact_avatar from " . $this->getTable() . " cu\n\t\t\tjoin contacts c on c.idcontacts = cu.idcontacts\n\t\t\twhere \n\t\t\tcu.`email` = ? \n\t\t\tAND cu.`password` = ?\n\t\t\tAND c.deleted = 0\n\t\t\tAND c.portal_user = 1\n\t\t\t";
$this->query($qry, array($evctl->user_name, MD5($evctl->user_password)));
if ($this->getNumRows() == 1) {
$this->next();
$idcpanel_user = $this->idcpanel_user;
$login_success = true;
} elseif ($this->getNumRows() > 1) {
$msg = _('Looks like you have multiple login for the customer portal for different organization, please ask the provider to reset the password for one');
} else {
$msg = _('Authentication failed ! Invalid login details');
}
if (true === $login_success) {
$this->set_subordinates($this->idcpanel_user, $this->idorganization);
$_SESSION["do_cpanel_action_permission"]->load_cpanel_user_modules($this->idorganization);
$this->sessionPersistent("do_cpaneluser", "logout.php", TTL_LONG);
if (!is_object($_SESSION["do_global_settings"])) {
$do_global_settings = new \CRMGlobalSettings();
$do_global_settings->sessionPersistent("do_global_settings", "logout.php", TTL);
}
$dis = new \Display($evctl->goto);
//@see view/login_view
if ((int) $evctl->sqrecord > 0) {
$dis->addParam("sqrecord", (int) $evctl->sqrecord);
}
$evctl->setDisplayNext($dis);
} else {
$_SESSION["do_cpanel_messages"]->set_message('error', $msg);
}
} else {
$_SESSION["do_cpanel_messages"]->set_message('error', _('Missing email or password for authentication'));
}
}
示例12: eventAddNewRole
/**
* event function to add a new role
* @param object $evctl
*/
public function eventAddNewRole(EventControler $evctl)
{
$permission = $_SESSION["do_user"]->is_admin == 1 ? true : false;
if (true === $permission) {
if ($evctl->rolename != '' && $evctl->parentrole != '') {
$role_detail = $this->get_role_detail($evctl->parentrole);
if (is_array($role_detail) && count($role_detail) > 0) {
$depth_lookup = $role_detail["depth"] + 1;
$qry = "select max(idrole) as max_role from `role`";
$stmt = $this->getDbConnection()->executeQuery($qry);
$data = $stmt->fetch();
$max_role = $data["max_role"];
if ($max_role != '') {
$role_int = str_replace("N", "", $max_role);
$new_role_int = $role_int + 1;
$new_role = "N" . $new_role_int;
$new_parent_role = $role_detail["parentrole"] . "::" . $new_role;
$this->insert($this->getTable(), array("idrole" => $new_role, "rolename" => CommonUtils::purify_input($evctl->rolename), "parentrole" => $new_parent_role, "depth" => $depth_lookup, "editable" => 1));
// Adding role profile relation
$profiles = $evctl->select_to;
foreach ($profiles as $idprofile) {
$do_role_prof_rel = new RoleProfileRelation();
$do_role_prof_rel->addNew();
$do_role_prof_rel->idrole = $new_role;
$do_role_prof_rel->idprofile = $idprofile;
$do_role_prof_rel->add();
$do_role_prof_rel->free();
}
$dis = new Display($evctl->next_page);
$dis->addParam("sqrecord", $idprofile);
$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);
}
}
示例13: fread
$datastructure = fread($fp, filesize($conx->getProjectDirectory() . "backupsync.struct.sql"));
fclose($fp);
$queries = getSQLStatements($datastructure);
$conx->setBackupSync(false);
$runquery = new sqlQuery($conx);
foreach ($queries as $query) {
$query = trim($query);
if (strlen($query) > 3) {
$runquery->query($query);
}
}
$fp = fopen($conx->getProjectDirectory() . "backupsync.struct.sql", "w");
fclose($fp);
$error = false;
if (strlen($runquery->getError()) > 5) {
$this->setError("SQL query Error during structure importation : " . $runquery->getError());
$error = true;
}
if ($error) {
$message = "Error, Datastructure import one or more query didn't go true during the structure importation";
$this->setError($message);
} else {
$message = "Importation done";
}
} else {
$message = "Error, Event Controler, Data Structure : mydb_key doesn't match";
$this->setError($message);
}
$disp = new Display($this->getMessagePage());
$disp->addParam("message", $message);
$this->setDisplayNext($disp);
示例14: Display
$suplier = 53;
}
if (eregi("TRAFFICSWARM", $do_import_expense->description)) {
$category = 16;
}
if (eregi("DELL", $do_import_expense->description)) {
$category = 13;
$suplier = 73;
}
if (eregi("T-MOBILE", $do_import_expense->description)) {
$category = 12;
$category = 119;
}
if ($category != 0) {
$do_expense->newRecord();
$do_expense->num = $do_import_expense->idexpense_import;
$do_expense->description = $do_import_expense->description;
$do_expense->datepayed = $do_import_expense->debit_date;
$do_expense->daterecieve = $do_import_expense->debit_date;
$do_expense->amount = $do_import_expense->amount;
$do_expense->type = $category;
if ($suplier != 0) {
$do_expense->suplier = $suplier;
}
$do_expense->add();
$do_import_expense->delete();
}
}
$disp = new Display($goto);
$disp->addParam("message", "Import completed");
$this->setDisplayNext($disp);
示例15: eventAddCustomField
//.........这里部分代码省略.........
$custom_field_type = $evctl->custom_field_type;
$req = $evctl->cf_req;
$field_validation = array();
$is_required = false;
if ($req == 'on') {
$is_required = true;
$field_validation["required"] = true;
}
$field_data_type = '';
switch ($custom_field_type) {
case 1:
$fld_length = (int) $evctl->cf_len;
$field_data_type = 'VARCHAR(' . $fld_length . ')';
if ($is_required === true) {
if ($evctl->cf_max_len != '' || (int) $evctl->cf_max_len > 0) {
$field_validation["maxlength"] = (int) $evctl->cf_max_len;
}
if ($evctl->cf_min_len != '' || (int) $evctl->cf_min_len > 0) {
$field_validation["minlength"] = (int) $evctl->cf_min_len;
}
}
break;
case 2:
$field_data_type = 'TEXT';
break;
case 3:
$field_data_type = 'VARCHAR(3)';
break;
case 5:
$pick_values = $evctl->cf_pick;
$not_equal = $evctl->cf_pick_notequal;
if ($is_required === true) {
$field_validation["notEqual"] = $not_equal;
}
$field_data_type = 'VARCHAR(100)';
break;
case 6:
$pick_values = $evctl->cf_pick;
$field_data_type = 'VARCHAR(100)';
break;
case 7:
$fld_length = (int) $evctl->cf_len;
$field_data_type = 'VARCHAR(' . $fld_length . ')';
break;
case 8:
$fld_length = (int) $evctl->cf_len;
$field_data_type = 'VARCHAR(' . $fld_length . ')';
break;
case 9:
$field_data_type = 'DATE';
break;
case 10:
$field_data_type = 'VARCHAR(10)';
break;
case 210:
$field_data_type = 'VARCHAR(15)';
break;
}
if (count($field_validation) > 0) {
$field_validation_entry = json_encode($field_validation);
} else {
$field_validation_entry = '';
}
$qry = "select * from " . $this->getTable() . " where field_name like '%ctf_%' order by idfields desc limit 1 ";
$stmt = $this->getDbConnection()->executeQuery($qry);
if ($stmt->rowCount() > 0) {
$data = $stmt->fetch();
$last_custom_field = $data["field_name"];
$field_sequence = $data["field_sequence"];
$last_custom_field_explode = explode("_", $last_custom_field);
$custom_field_suffix = $last_custom_field_explode[1];
$new_custom_field_suffix = $custom_field_suffix + 1;
$custom_field_name = "ctf_" . $new_custom_field_suffix;
$custom_field_sequence = $field_sequence + 1;
} else {
$custom_field_name = "ctf_1";
$custom_field_sequence = 1;
}
$insert_data = array('field_name' => $custom_field_name, 'field_label' => CommonUtils::purify_input($evctl->cf_label), 'field_sequence' => $custom_field_sequence, 'idblock' => $this->get_custom_field_blocks($idmodule), 'idmodule' => $idmodule, 'table_name' => $this->get_custom_fields_tablename($idmodule), 'field_type' => $custom_field_type, 'field_validation' => $field_validation_entry);
$this->insert($this->getTable(), $insert_data);
$idfields = $this->getInsertId();
if ($idfields > 0) {
if ($custom_field_type == 5 || $custom_field_type == 6) {
//$pick_values_seperated = explode(PHP_EOL,$evctl->cf_pick);
$pick_values_seperated = preg_split('/[\\r\\n]+/', $evctl->cf_pick, -1, PREG_SPLIT_NO_EMPTY);
$do_combo_values = new ComboValues();
$do_combo_values->add_combo_values($idfields, $pick_values_seperated);
}
// add field to the custom field table for the moduleedit_custom_field_modal
$qry_alter = "\n\t\t\talter table `" . $this->get_custom_fields_tablename($idmodule) . "` \n\t\t\tadd column `{$custom_field_name}` {$field_data_type}\n\t\t\t";
$this->query($qry_alter);
$_SESSION["do_crm_messages"]->set_message('success', _('Custom field added successfully.'));
$next_page = NavigationControl::getNavigationLink("Settings", "customfield");
$dis = new Display($next_page);
$dis->addParam("cmid", $idmodule);
$evctl->setDisplayNext($dis);
} else {
$_SESSION["do_crm_messages"]->set_message('error', _('Custom field could not be added, please try again ! '));
}
}