The Organizer is a tool you can use to copy reports, calendars, and other elements to other projects, or to the Global template (Global.MPT). Copying an element to the Global template makes it available to all your projects.
PermalinkJoin GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up Find file Copy path
Cannot retrieve contributors at this time
// Copyright (c) 2014-2018, The Monero Project |
// Copyright (c) 2018, The Loki Project |
// |
// All rights reserved. |
// |
// Redistribution and use in source and binary forms, with or without modification, are |
// permitted provided that the following conditions are met: |
// |
// 1. Redistributions of source code must retain the above copyright notice, this list of |
// conditions and the following disclaimer. |
// |
// 2. Redistributions in binary form must reproduce the above copyright notice, this list |
// of conditions and the following disclaimer in the documentation and/or other |
// materials provided with the distribution. |
// |
// 3. Neither the name of the copyright holder nor the names of its contributors may be |
// used to endorse or promote products derived from this software without specific |
// prior written permission. |
// |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY |
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// |
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers |
#include'include_base_utils.h' |
usingnamespaceepee; |
#include'cryptonote_basic_impl.h' |
#include'string_tools.h' |
#include'serialization/binary_utils.h' |
#include'serialization/container.h' |
#include'cryptonote_format_utils.h' |
#include'cryptonote_config.h' |
#include'misc_language.h' |
#include'common/base58.h' |
#include'crypto/hash.h' |
#include'int-util.h' |
#include'common/dns_utils.h' |
#include'common/loki.h' |
#undef LOKI_DEFAULT_LOG_CATEGORY |
#defineLOKI_DEFAULT_LOG_CATEGORY'cn' |
namespacecryptonote { |
structintegrated_address { |
account_public_address adr; |
crypto::hash8 payment_id; |
BEGIN_SERIALIZE_OBJECT() |
FIELD(adr) |
FIELD(payment_id) |
END_SERIALIZE() |
BEGIN_KV_SERIALIZE_MAP() |
KV_SERIALIZE(adr) |
KV_SERIALIZE(payment_id) |
END_KV_SERIALIZE_MAP() |
}; |
/************************************************************************/ |
/* Cryptonote helper functions */ |
/************************************************************************/ |
//----------------------------------------------------------------------------------------------- |
size_tget_min_block_weight(uint8_t version) |
{ |
if (version < 2) |
return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1; |
if (version < 5) |
return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2; |
return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5; |
} |
//----------------------------------------------------------------------------------------------- |
size_tget_max_block_size() |
{ |
return CRYPTONOTE_MAX_BLOCK_SIZE; |
} |
//----------------------------------------------------------------------------------------------- |
size_tget_max_tx_size() |
{ |
return CRYPTONOTE_MAX_TX_SIZE; |
} |
//----------------------------------------------------------------------------------------------- |
boolget_base_block_reward(size_t median_weight, size_t current_block_weight, uint64_t already_generated_coins, uint64_t &reward, uint8_t version, uint64_t height) { |
//premine reward |
if (already_generated_coins 0) |
{ |
reward = 22500000000000000; |
returntrue; |
} |
static_assert(DIFFICULTY_TARGET_V2%600,'difficulty targets must be a multiple of 60'); |
uint64_t emission_supply_component = (already_generated_coins * EMISSION_SUPPLY_MULTIPLIER) / EMISSION_SUPPLY_DIVISOR; |
uint64_t base_reward = (EMISSION_LINEAR_BASE - emission_supply_component) / EMISSION_DIVISOR; |
// Check if we just overflowed |
if (emission_supply_component > EMISSION_LINEAR_BASE) { |
base_reward = 0; |
} |
if (version >= 8) |
base_reward = 28000000000.0 + 100000000000.0 / loki::exp2(height / (720.0 * 90.0)); // halve every 90 days. |
uint64_t full_reward_zone = get_min_block_weight(version); |
//make it soft |
if (median_weight < full_reward_zone) { |
median_weight = full_reward_zone; |
} |
if (current_block_weight <= median_weight) { |
reward = base_reward; |
returntrue; |
} |
if(current_block_weight > 2 * median_weight) { |
MERROR('Block cumulative weight is too big: ' << current_block_weight << ', expected less than ' << 2 * median_weight); |
returnfalse; |
} |
assert(median_weight < std::numeric_limits<uint32_t>::max()); |
assert(current_block_weight < std::numeric_limits<uint32_t>::max()); |
uint64_t product_hi; |
// BUGFIX: 32-bit saturation bug (e.g. ARM7), the result was being |
// treated as 32-bit by default. |
uint64_t multiplicand = 2 * median_weight - current_block_weight; |
multiplicand *= current_block_weight; |
uint64_t product_lo = mul128(base_reward, multiplicand, &product_hi); |
uint64_t reward_hi; |
uint64_t reward_lo; |
div128_32(product_hi, product_lo, static_cast<uint32_t>(median_weight), &reward_hi, &reward_lo); |
div128_32(reward_hi, reward_lo, static_cast<uint32_t>(median_weight), &reward_hi, &reward_lo); |
assert(0 reward_hi); |
assert(reward_lo < base_reward); |
reward = reward_lo; |
returntrue; |
} |
//------------------------------------------------------------------------------------ |
uint8_tget_account_address_checksum(const public_address_outer_blob& bl) |
{ |
constunsignedchar* pbuf = reinterpret_cast<constunsignedchar*>(&bl); |
uint8_t summ = 0; |
for(size_t i = 0; i!= sizeof(public_address_outer_blob)-1; i++) |
summ += pbuf[i]; |
return summ; |
} |
//------------------------------------------------------------------------------------ |
uint8_tget_account_integrated_address_checksum(const public_integrated_address_outer_blob& bl) |
{ |
constunsignedchar* pbuf = reinterpret_cast<constunsignedchar*>(&bl); |
uint8_t summ = 0; |
for(size_t i = 0; i!= sizeof(public_integrated_address_outer_blob)-1; i++) |
summ += pbuf[i]; |
return summ; |
} |
//----------------------------------------------------------------------- |
std::string get_account_address_as_str( |
network_type nettype |
, bool subaddress |
, account_public_address const & adr |
) |
{ |
uint64_t address_prefix = subaddress ? get_config(nettype).CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX : get_config(nettype).CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX; |
returntools::base58::encode_addr(address_prefix, t_serializable_object_to_blob(adr)); |
} |
//----------------------------------------------------------------------- |
std::string get_account_integrated_address_as_str( |
network_type nettype |
, account_public_address const & adr |
, crypto::hash8 const & payment_id |
) |
{ |
uint64_t integrated_address_prefix = get_config(nettype).CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX; |
integrated_address iadr = { |
adr, payment_id |
}; |
returntools::base58::encode_addr(integrated_address_prefix, t_serializable_object_to_blob(iadr)); |
} |
//----------------------------------------------------------------------- |
boolis_coinbase(const transaction& tx) |
{ |
if(tx.vin.size() != 1) |
returnfalse; |
if(tx.vin[0].type() != typeid(txin_gen)) |
returnfalse; |
returntrue; |
} |
//----------------------------------------------------------------------- |
boolget_account_address_from_str( |
address_parse_info& info |
, network_type nettype |
, std::string const & str |
) |
{ |
uint64_t address_prefix = get_config(nettype).CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX; |
uint64_t integrated_address_prefix = get_config(nettype).CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX; |
uint64_t subaddress_prefix = get_config(nettype).CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX; |
if (2 * sizeof(public_address_outer_blob) != str.size()) |
{ |
blobdata data; |
uint64_t prefix; |
if (!tools::base58::decode_addr(str, prefix, data)) |
{ |
LOG_PRINT_L2('Invalid address format'); |
returnfalse; |
} |
if (integrated_address_prefix prefix) |
{ |
info.is_subaddress = false; |
info.has_payment_id = true; |
} |
elseif (address_prefix prefix) |
{ |
info.is_subaddress = false; |
info.has_payment_id = false; |
} |
elseif (subaddress_prefix prefix) |
{ |
info.is_subaddress = true; |
info.has_payment_id = false; |
} |
else { |
LOG_PRINT_L1('Wrong address prefix: ' << prefix << ', expected ' << address_prefix |
<< ' or ' << integrated_address_prefix |
<< ' or ' << subaddress_prefix); |
returnfalse; |
} |
if (info.has_payment_id) |
{ |
integrated_address iadr; |
if (!::serialization::parse_binary(data, iadr)) |
{ |
LOG_PRINT_L1('Account public address keys can't be parsed'); |
returnfalse; |
} |
info.address = iadr.adr; |
info.payment_id = iadr.payment_id; |
} |
else |
{ |
if (!::serialization::parse_binary(data, info.address)) |
{ |
LOG_PRINT_L1('Account public address keys can't be parsed'); |
returnfalse; |
} |
} |
if (!crypto::check_key(info.address.m_spend_public_key) || !crypto::check_key(info.address.m_view_public_key)) |
{ |
LOG_PRINT_L1('Failed to validate address keys'); |
returnfalse; |
} |
} |
else |
{ |
// Old address format |
std::string buff; |
if(!string_tools::parse_hexstr_to_binbuff(str, buff)) |
returnfalse; |
if(buff.size()!=sizeof(public_address_outer_blob)) |
{ |
LOG_PRINT_L1('Wrong public address size: ' << buff.size() << ', expected size: ' << sizeof(public_address_outer_blob)); |
returnfalse; |
} |
public_address_outer_blob blob = *reinterpret_cast<const public_address_outer_blob*>(buff.data()); |
if(blob.m_ver > CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER) |
{ |
LOG_PRINT_L1('Unknown version of public address: ' << blob.m_ver << ', expected ' << CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER); |
returnfalse; |
} |
if(blob.check_sum != get_account_address_checksum(blob)) |
{ |
LOG_PRINT_L1('Wrong public address checksum'); |
returnfalse; |
} |
//we success |
info.address = blob.m_address; |
info.is_subaddress = false; |
info.has_payment_id = false; |
} |
returntrue; |
} |
//-------------------------------------------------------------------------------- |
boolget_account_address_from_str_or_url( |
address_parse_info& info |
, network_type nettype |
, const std::string& str_or_url |
, std::function<std::string(const std::string&, const std::vector<std::string>&, bool)> dns_confirm |
) |
{ |
if (get_account_address_from_str(info, nettype, str_or_url)) |
returntrue; |
bool dnssec_valid; |
std::string address_str = tools::dns_utils::get_account_address_as_str_from_url(str_or_url, dnssec_valid, dns_confirm); |
return !address_str.empty() && |
get_account_address_from_str(info, nettype, address_str); |
} |
//-------------------------------------------------------------------------------- |
booloperator (const cryptonote::transaction& a, const cryptonote::transaction& b) { |
returncryptonote::get_transaction_hash(a) cryptonote::get_transaction_hash(b); |
} |
booloperator (const cryptonote::block& a, const cryptonote::block& b) { |
returncryptonote::get_block_hash(a) cryptonote::get_block_hash(b); |
} |
} |
//-------------------------------------------------------------------------------- |
boolparse_hash256(const std::string &str_hash, crypto::hash& hash) |
{ |
std::string buf; |
bool res = epee::string_tools::parse_hexstr_to_binbuff(str_hash, buf); |
if (!res || buf.size() != sizeof(crypto::hash)) |
{ |
MERROR('invalid hash format: ' << str_hash); |
returnfalse; |
} |
else |
{ |
buf.copy(reinterpret_cast<char *>(&hash), sizeof(crypto::hash)); |
returntrue; |
} |
} |
Copy lines Copy permalink
WindowsOnline
The Organizer is a tool you can use to copy reports, calendars, and other elements to other projects, or to the Global template (Global.MPT). Copying an element to the Global template makes it available to all your projects.
However, you may not need to use the Organizer to accomplish what you want. In fact, Project’s default behavior is to automatically copy all new views and related elements you create to the Global template. This also applies to existing elements you save with a new name. To change this behavior, choose File > Options > Advanced. The setting is in the Display section:
Use the Organizer
If you have unchecked the setting described above and want to copy selected elements to the Global template, or if you want to copy an element from one project to another, you’ll need to use the Organizer.
The Organizer can also copy custom text styles to other projects or to the Global template. For more information, see Change the text font in a view.
Notes:
![Copy Copy](https://i.gr-assets.com/images/S/compressed.photo.goodreads.com/books/1516656597i/38124998._UY630_SR1200,630_.jpg)
- You can’t copy task information using the Organizer. If you want specific tasks to be part of each project, save the project file as a regular template.
- Values in custom value lists (i.e. lookup values) can’t be stored in the Global template. Use a regular template for this situation as well.
Copy elements to the Global template
Suppose you customize the default Gantt chart with cost columns, and now you want to use the new chart in your future projects. Follow these steps to copy the view to the Global template:
- Choose File > Organizer.(In Project 2007, choose Tools > Organizer.)
- In the Organizer dialog box, select the Views tab.Note: To copy other project elements, choose a different tab, such as Calendars.The list on the left shows elements in the Global template, while the list on the right shows the elements in the current project. Your job is to move the custom element from the right side to the left side.Note: To see Project elements from other projects, you’ll need to open those projects first.
- Select the custom view on the right side, and then choose Copy.
The custom view is copied to the Global template and displayed on the left side. - If your customized view contains columns you’ve added, then you’ll need to copy over the associated table. Select the Tables tab, and then copy the table to the Global template. The associated table may have the same name as the view, but if you don’t see a likely match, copy the Entry table.All your projects will have the custom view available to them with the correct underlying table.
Copy elements directly to another project
If you want to copy Project elements from one project to another (but not to the Global template):
- Open both projects (the “source” project containing the customized elements, and the “destination” project to which you want to copy them).
- In the source project, choose File > Organizer.(In Project 2007, choose Tools > Organizer.)
- In the availability list, select the destination project.Note: To copy other project elements, choose a different tab, such as Calendars.
- Select the custom elements on the right side, and then choose Copy to copy them to the destination project.
If an existing calendar has many of the same holidays and other calendar items that you want to use in a new calendar, you can base a new calendar on an existing calendar. Copy the existing calendar in Microsoft Project Web App, and then modify the copy in the desktop version of Project. For example, if the standard calendar in your organization captures all of the organization's unique holidays and events, but you need a separate calendar to reflect an all day, every day working schedule, you can copy the standard calendar and then modify it for the all day, every day schedule.
To create a new calendar as a copy of an existing calendar:
- On the Quick Launch, in the Settings section, choose Server Settings.
- On the Server Settings page, in the Enterprise Data section, choose Enterprise Calendars.
- Select the row that contains the calendar that you want to copy, and then choose Copy Calendar.
- On the Copy Calendar dialog box, type the name that you want to use for the new calendar in the Name box, and then choose OK.The calendar is added to the list on the Enterprise Calendars page.
- Select the row that contains the new, copied calendar, and then choose Edit Calendar.If the Windows Security dialog box appears, log on to Microsoft Project Server 2010.Project Professional opens and displays the Change Working Time dialog box.
- Use the calendar with the Exceptions and Work Weeks tabs to modify the working and nonworking times for your organization. For more information, see Modify working and nonworking times.
- Choose OK on the Change Working Time dialog box to save the new calendar to Project Server.
- Close Project.