Add php files
This commit is contained in:
1229
modules/Accounts/Account.php
Normal file
1229
modules/Accounts/Account.php
Normal file
File diff suppressed because it is too large
Load Diff
587
modules/Accounts/AccountFormBase.php
Normal file
587
modules/Accounts/AccountFormBase.php
Normal file
@@ -0,0 +1,587 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: base form for account
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
class AccountFormBase{
|
||||
|
||||
|
||||
function checkForDuplicates($prefix){
|
||||
require_once('include/formbase.php');
|
||||
|
||||
$focus = new Account();
|
||||
$query = '';
|
||||
$baseQuery = 'select id, name, website, billing_address_city from accounts where deleted!=1 and ';
|
||||
if(!empty($_POST[$prefix.'name'])){
|
||||
$query = $baseQuery ." name like '".$_POST[$prefix.'name']."%'";
|
||||
}
|
||||
|
||||
if(!empty($_POST[$prefix.'billing_address_city']) || !empty($_POST[$prefix.'register_address_city'])){
|
||||
|
||||
$temp_query = '';
|
||||
if(!empty($_POST[$prefix.'billing_address_city'])){
|
||||
if(empty($temp_query)){
|
||||
$temp_query = " billing_address_city like '".$_POST[$prefix.'billing_address_city']."%'";
|
||||
}else {
|
||||
$temp_query .= "or billing_address_city like '".$_POST[$prefix.'billing_address_city']."%'";
|
||||
}
|
||||
}
|
||||
if(!empty($_POST[$prefix.'register_address_city'])){
|
||||
if(empty($temp_query)){
|
||||
$temp_query = " register_address_city like '".$_POST[$prefix.'register_address_city']."%'";
|
||||
}else {
|
||||
$temp_query .= "or register_address_city like '".$_POST[$prefix.'register_address_city']."%'";
|
||||
}
|
||||
}
|
||||
if(empty($query)){
|
||||
$query .= $baseQuery;
|
||||
}else{
|
||||
$query .= ' AND ';
|
||||
}
|
||||
$query .= ' ('. $temp_query . ' ) ';
|
||||
|
||||
}
|
||||
|
||||
if(!empty($query)){
|
||||
$rows = array();
|
||||
global $db;
|
||||
$result = $db->query($query);
|
||||
$i=-1;
|
||||
while(($row=$db->fetchByAssoc($result)) != null) {
|
||||
$i++;
|
||||
$rows[$i] = $row;
|
||||
}
|
||||
if ($i==-1) return null;
|
||||
|
||||
return $rows;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
function buildTableForm($rows, $mod='Accounts'){
|
||||
if(!ACLController::checkAccess('Accounts', 'edit', true)){
|
||||
return '';
|
||||
}
|
||||
global $action;
|
||||
if(!empty($mod)){
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, $mod);
|
||||
}else global $mod_strings;
|
||||
global $app_strings;
|
||||
$cols = sizeof($rows[0]) * 2 + 1;
|
||||
if ($action != 'ShowDuplicates')
|
||||
{
|
||||
$form = "<form action='index.php' method='post' id='dupAccounts' name='dupAccounts'><input type='hidden' name='selectedAccount' value=''>";
|
||||
$form .= '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>';
|
||||
unset($_POST['selectedAccount']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_SHOW_DUPLICATES']. '</td></tr><tr><td height="20"></td></tr></table>';
|
||||
}
|
||||
|
||||
if(isset($_POST['return_action']) && $_POST['return_action'] == 'SubPanelViewer') {
|
||||
$_POST['return_action'] = 'DetailView';
|
||||
}
|
||||
|
||||
if(isset($_POST['return_action']) && $_POST['return_action'] == 'DetailView' && empty($_REQUEST['return_id'])) {
|
||||
unset($_POST['return_action']);
|
||||
}
|
||||
|
||||
$form .= "<table width='100%' cellpadding='0' cellspacing='0' class='list view' border='0'><tr class='pagination'><td colspan='$cols'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td>";
|
||||
// handle buttons
|
||||
if ($action == 'ShowDuplicates') {
|
||||
$return_action = 'ListView'; // cn: bug 6658 - hardcoded return action break popup -> create -> duplicate -> cancel
|
||||
$return_action = (isset($_REQUEST['return_action']) && !empty($_REQUEST['return_action'])) ? $_REQUEST['return_action'] : $return_action;
|
||||
$form .= "<input type='hidden' name='selectedAccount' id='selectedAccount' value=''><input title='${app_strings['LBL_SAVE_BUTTON_TITLE']}' accessKey='${app_strings['LBL_SAVE_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' ${app_strings['LBL_SAVE_BUTTON_LABEL']} '>\n";
|
||||
|
||||
if (!empty($_REQUEST['return_module']) && !empty($_REQUEST['return_action']) && !empty($_REQUEST['return_id']))
|
||||
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='${app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='".$_REQUEST['return_module']."';this.form.action.value='".$_REQUEST['return_action']."';this.form.record.value='".$_REQUEST['return_id']."'\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
|
||||
else if (!empty($_POST['return_module']) && !empty($_POST['return_action']))
|
||||
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='${app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.module.value='".$_POST['return_module']."';this.form.action.value='". $_POST['return_action']."';\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
|
||||
else
|
||||
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' accessKey='${app_strings['LBL_CANCEL_BUTTON_KEY']}' class='button' onclick=\"this.form.action.value='ListView';\" type='submit' type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
|
||||
} else {
|
||||
$form .= "<input type='submit' class='button' name='ContinueAccount' value='${mod_strings['LNK_NEW_ACCOUNT']}'>\n";
|
||||
}
|
||||
$form .= "</td></tr></table></td></tr><tr>";
|
||||
if ($action != 'ShowDuplicates')
|
||||
{
|
||||
$form .= "<th> </th>";
|
||||
}
|
||||
require_once('include/formbase.php');
|
||||
|
||||
$form .= getPostToForm();
|
||||
if(isset($rows[0])){
|
||||
foreach ($rows[0] as $key=>$value){
|
||||
if($key != 'id'){
|
||||
|
||||
$form .= "<th>". $mod_strings[$mod_strings['db_'.$key]]. "</th>";
|
||||
}}
|
||||
|
||||
$form .= "</tr>";
|
||||
}
|
||||
|
||||
$rowColor = 'oddListRowS1';
|
||||
foreach($rows as $row){
|
||||
|
||||
$form .= "<tr class='$rowColor'>";
|
||||
if ($action != 'ShowDuplicates')
|
||||
{
|
||||
$form .= "<td width='1%' nowrap><a href='javascript:void(0)' onclick='document.dupAccounts.selectedAccount.value=\"${row['id']}\"; document.dupAccounts.submit(); '>[${app_strings['LBL_SELECT_BUTTON_LABEL']}]</a> </td>\n";
|
||||
}
|
||||
foreach ($row as $key=>$value){
|
||||
if($key != 'id'){
|
||||
if(isset($_POST['popup']) && $_POST['popup']==true){
|
||||
$form .= "<td scope='row'><a href='javascript:void(0)' onclick=\"window.opener.location='index.php?module=Accounts&action=DetailView&record=${row['id']}'\">$value</a></td>\n";
|
||||
}
|
||||
else
|
||||
$form .= "<td><a target='_blank' href='index.php?module=Accounts&action=DetailView&record=${row['id']}'>$value</a></td>\n";
|
||||
|
||||
}}
|
||||
|
||||
if($rowColor == 'evenListRowS1'){
|
||||
$rowColor = 'oddListRowS1';
|
||||
}else{
|
||||
$rowColor = 'evenListRowS1';
|
||||
}
|
||||
$form .= "</tr>";
|
||||
}
|
||||
$form .= "<tr class='pagination'><td colspan='$cols'><table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td>";
|
||||
|
||||
// handle buttons
|
||||
if ($action == 'ShowDuplicates') {
|
||||
$return_action = 'ListView'; // cn: bug 6658 - hardcoded return action break popup -> create -> duplicate -> cancel
|
||||
$return_action = (isset($_REQUEST['return_action']) && !empty($_REQUEST['return_action'])) ? $_REQUEST['return_action'] : $return_action;
|
||||
$form .= "<input type='hidden' name='selectedAccount' id='selectedAccount' value=''><input title='${app_strings['LBL_SAVE_BUTTON_TITLE']}' class='button' onclick=\"this.form.action.value='Save';\" type='submit' name='button' value=' ${app_strings['LBL_SAVE_BUTTON_LABEL']} '>\n";
|
||||
|
||||
if (!empty($_REQUEST['return_module']) && !empty($_REQUEST['return_action']) && !empty($_REQUEST['return_id']))
|
||||
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' class='button' onclick=\"this.form.module.value='".$_REQUEST['return_module']."';this.form.action.value='".$_REQUEST['return_action']."';this.form.record.value='".$_REQUEST['return_id']."'\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
|
||||
else if (!empty($_POST['return_module']) && !empty($_POST['return_action']))
|
||||
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' class='button' onclick=\"this.form.module.value='".$_POST['return_module']."';this.form.action.value='". $_POST['return_action']."';\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
|
||||
else
|
||||
$form .= "<input title='${app_strings['LBL_CANCEL_BUTTON_TITLE']}' class='button' onclick=\"this.form.action.value='ListView';\" type='submit' name='button' value=' ${app_strings['LBL_CANCEL_BUTTON_LABEL']} '>";
|
||||
} else {
|
||||
$form .= "<input type='submit' class='button' name='ContinueAccount' value='${mod_strings['LNK_NEW_ACCOUNT']}'></form>\n";
|
||||
}
|
||||
$form .= "</td></tr></table></td></tr></table>";
|
||||
return $form;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function getForm($prefix, $mod='', $form=''){
|
||||
if(!ACLController::checkAccess('Accounts', 'edit', true)){
|
||||
return '';
|
||||
}
|
||||
if(!empty($mod)){
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, $mod);
|
||||
}else global $mod_strings;
|
||||
global $app_strings;
|
||||
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
|
||||
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
|
||||
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
|
||||
|
||||
|
||||
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
|
||||
$the_form .= <<<EOQ
|
||||
<form name="${prefix}AccountSave" onSubmit="return check_form('${prefix}AccountSave');" method="POST" action="index.php">
|
||||
<input type="hidden" name="${prefix}module" value="Accounts">
|
||||
<input type="hidden" name="${prefix}action" value="Save">
|
||||
EOQ;
|
||||
$the_form .= $this->getFormBody($prefix, $mod, $prefix."AccountSave");
|
||||
$the_form .= <<<EOQ
|
||||
<p><input title="$lbl_save_button_title" accessKey="$lbl_save_button_key" class="button" type="submit" name="button" value=" $lbl_save_button_label " ></p>
|
||||
</form>
|
||||
|
||||
EOQ;
|
||||
$the_form .= get_left_form_footer();
|
||||
$the_form .= get_validate_record_js();
|
||||
|
||||
return $the_form;
|
||||
}
|
||||
|
||||
|
||||
function getFormBody($prefix,$mod='', $formname=''){
|
||||
if(!ACLController::checkAccess('Accounts', 'edit', true)){
|
||||
return '';
|
||||
}
|
||||
global $mod_strings;
|
||||
$temp_strings = $mod_strings;
|
||||
if(!empty($mod)){
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, $mod);
|
||||
}
|
||||
global $app_strings;
|
||||
global $current_user;
|
||||
|
||||
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
|
||||
$lbl_account_name = $mod_strings['LBL_ACCOUNT_NAME'];
|
||||
$lbl_phone = $mod_strings['LBL_PHONE'];
|
||||
$lbl_website = $mod_strings['LBL_WEBSITE'];
|
||||
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
|
||||
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
|
||||
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
|
||||
$user_id = $current_user->id;
|
||||
|
||||
$form = <<<EOQ
|
||||
<p><input type="hidden" name="record" value="">
|
||||
<input type="hidden" name="email1" value="">
|
||||
<input type="hidden" name="email2" value="">
|
||||
<input type="hidden" name="assigned_user_id" value='${user_id}'>
|
||||
<input type="hidden" name="action" value="Save">
|
||||
EOQ;
|
||||
$form .= "$lbl_account_name <span class='required'>$lbl_required_symbol</span><br><input name='name' type='text' value=''><br>";
|
||||
$form .= "$lbl_phone<br><input name='phone_office' type='text' value=''><br>";
|
||||
$form .= "$lbl_website<br><input name='website' type='text' value='http://'><br>";
|
||||
$form .='</p>';
|
||||
|
||||
|
||||
|
||||
$javascript = new javascript();
|
||||
$javascript->setFormName($formname);
|
||||
$javascript->setSugarBean(new Account());
|
||||
$javascript->addRequiredFields($prefix);
|
||||
$form .=$javascript->getScript();
|
||||
$mod_strings = $temp_strings;
|
||||
return $form;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getWideFormBody($prefix, $mod='',$formname='', $contact=''){
|
||||
if(!ACLController::checkAccess('Accounts', 'edit', true)){
|
||||
return '';
|
||||
}
|
||||
|
||||
if(empty($contact)){
|
||||
$contact = new Contact();
|
||||
}
|
||||
global $mod_strings;
|
||||
$temp_strings = $mod_strings;
|
||||
if(!empty($mod)){
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, $mod);
|
||||
}
|
||||
global $app_strings;
|
||||
global $current_user;
|
||||
$account = new Account();
|
||||
|
||||
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
|
||||
$lbl_account_name = $mod_strings['LBL_ACCOUNT_NAME'];
|
||||
$lbl_phone = $mod_strings['LBL_PHONE'];
|
||||
$lbl_website = $mod_strings['LBL_WEBSITE'];
|
||||
if (isset($contact->assigned_user_id)) {
|
||||
$user_id=$contact->assigned_user_id;
|
||||
} else {
|
||||
$user_id = $current_user->id;
|
||||
}
|
||||
|
||||
//Retrieve Email address and set email1, email2
|
||||
$sugarEmailAddress = new SugarEmailAddress();
|
||||
$sugarEmailAddress->handleLegacyRetrieve($contact);
|
||||
if(!isset($contact->email1)){
|
||||
$contact->email1 = '';
|
||||
}
|
||||
if(!isset($contact->email2)){
|
||||
$contact->email2 = '';
|
||||
}
|
||||
if(!isset($contact->email_opt_out)){
|
||||
$contact->email_opt_out = '';
|
||||
}
|
||||
$form="";
|
||||
$default_desc="";
|
||||
if (!empty($contact->description)) {
|
||||
$default_desc=$contact->description;
|
||||
}
|
||||
$form .= <<<EOQ
|
||||
<input type="hidden" name="${prefix}record" value="">
|
||||
<input type="hidden" name="${prefix}phone_fax" value="{$contact->phone_fax}">
|
||||
<input type="hidden" name="${prefix}phone_other" value="{$contact->phone_other}">
|
||||
<input type="hidden" name="${prefix}email1" value="{$contact->email1}">
|
||||
<input type="hidden" name="${prefix}email2" value="{$contact->email2}">
|
||||
<input type='hidden' name='${prefix}billing_address_street' value='{$contact->primary_address_street}'><input type='hidden' name='${prefix}billing_address_city' value='{$contact->primary_address_city}'><input type='hidden' name='${prefix}billing_address_state' value='{$contact->primary_address_state}'><input type='hidden' name='${prefix}billing_address_postalcode' value='{$contact->primary_address_postalcode}'><input type='hidden' name='${prefix}billing_address_country' value='{$contact->primary_address_country}'>
|
||||
<input type='hidden' name='${prefix}register_address_street' value='{$contact->alt_address_street}'><input type='hidden' name='${prefix}register_address_city' value='{$contact->alt_address_city}'><input type='hidden' name='${prefix}register_address_state' value='{$contact->alt_address_state}'><input type='hidden' name='${prefix}register_address_postalcode' value='{$contact->alt_address_postalcode}'><input type='hidden' name='${prefix}register_address_country' value='{$contact->alt_address_country}'>
|
||||
<input type="hidden" name="${prefix}assigned_user_id" value='${user_id}'>
|
||||
<input type='hidden' name='${prefix}do_not_call' value='{$contact->do_not_call}'>
|
||||
<input type='hidden' name='${prefix}email_opt_out' value='{$contact->email_opt_out}'>
|
||||
<table width='100%' border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="20%" nowrap scope="row">$lbl_account_name <span class="required">$lbl_required_symbol</span></td>
|
||||
<TD width="80%" nowrap scope="row">{$mod_strings['LBL_DESCRIPTION']}</TD>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap ><input name='{$prefix}name' type="text" value="$contact->account_name"></td>
|
||||
<TD rowspan="5" ><textarea name='{$prefix}description' rows='6' cols='50' >$default_desc</textarea></TD>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap scope="row">$lbl_phone</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap ><input name='{$prefix}phone_office' type="text" value="$contact->phone_work"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap scope="row">$lbl_website</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap ><input name='{$prefix}website' type="text" value="http://"></td>
|
||||
</tr>
|
||||
EOQ;
|
||||
//carry forward custom lead fields common to accounts during Lead Conversion
|
||||
$tempAccount = new Account();
|
||||
if (method_exists($contact, 'convertCustomFieldsForm')) $contact->convertCustomFieldsForm($form, $tempAccount, $prefix);
|
||||
unset($tempAccount);
|
||||
$form .= <<<EOQ
|
||||
</TABLE>
|
||||
EOQ;
|
||||
|
||||
|
||||
$javascript = new javascript();
|
||||
$javascript->setFormName($formname);
|
||||
$javascript->setSugarBean(new Account());
|
||||
$javascript->addRequiredFields($prefix);
|
||||
$form .=$javascript->getScript();
|
||||
$mod_strings = $temp_strings;
|
||||
return $form;
|
||||
}
|
||||
|
||||
|
||||
function handleSave($prefix,$redirect=true, $useRequired=false){
|
||||
|
||||
|
||||
require_once('include/formbase.php');
|
||||
|
||||
$focus = new Account();
|
||||
|
||||
if($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))){
|
||||
return null;
|
||||
}
|
||||
$focus = populateFromPost($prefix, $focus);
|
||||
|
||||
if (isset($GLOBALS['check_notify'])) {
|
||||
$check_notify = $GLOBALS['check_notify'];
|
||||
}
|
||||
else {
|
||||
$check_notify = FALSE;
|
||||
}
|
||||
|
||||
if (empty($_POST['record']) && empty($_POST['dup_checked'])) {
|
||||
$duplicateAccounts = $this->checkForDuplicates($prefix);
|
||||
if(isset($duplicateAccounts)){
|
||||
$location='module=Accounts&action=ShowDuplicates';
|
||||
$get = '';
|
||||
|
||||
// Bug 25311 - Add special handling for when the form specifies many-to-many relationships
|
||||
if(isset($_POST['relate_to']) && !empty($_POST['relate_to'])) {
|
||||
$get .= '&Accountsrelate_to='.$_POST['relate_to'];
|
||||
}
|
||||
if(isset($_POST['relate_id']) && !empty($_POST['relate_id'])) {
|
||||
$get .= '&Accountsrelate_id='.$_POST['relate_id'];
|
||||
}
|
||||
|
||||
//add all of the post fields to redirect get string
|
||||
foreach ($focus->column_fields as $field)
|
||||
{
|
||||
if (!empty($focus->$field) && !is_object($focus->$field))
|
||||
{
|
||||
$get .= "&Accounts$field=".urlencode($focus->$field);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($focus->additional_column_fields as $field)
|
||||
{
|
||||
if (!empty($focus->$field))
|
||||
{
|
||||
$get .= "&Accounts$field=".urlencode($focus->$field);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($focus->hasCustomFields()) {
|
||||
foreach($focus->field_defs as $name=>$field) {
|
||||
if (!empty($field['source']) && $field['source'] == 'custom_fields')
|
||||
{
|
||||
$get .= "&Accounts$name=".urlencode($focus->$name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$emailAddress = new SugarEmailAddress();
|
||||
$get .= $emailAddress->getFormBaseURL($focus);
|
||||
|
||||
|
||||
|
||||
//create list of suspected duplicate account id's in redirect get string
|
||||
$i=0;
|
||||
foreach ($duplicateAccounts as $account)
|
||||
{
|
||||
$get .= "&duplicate[$i]=".$account['id'];
|
||||
$i++;
|
||||
}
|
||||
|
||||
//add return_module, return_action, and return_id to redirect get string
|
||||
$get .= '&return_module=';
|
||||
if(!empty($_POST['return_module'])) $get .= $_POST['return_module'];
|
||||
else $get .= 'Accounts';
|
||||
$get .= '&return_action=';
|
||||
if(!empty($_POST['return_action'])) $get .= $_POST['return_action'];
|
||||
//else $get .= 'DetailView';
|
||||
if(!empty($_POST['return_id'])) $get .= '&return_id='.$_POST['return_id'];
|
||||
if(!empty($_POST['popup'])) $get .= '&popup='.$_POST['popup'];
|
||||
if(!empty($_POST['create'])) $get .= '&create='.$_POST['create'];
|
||||
|
||||
$_SESSION['SHOW_DUPLICATES'] = $get;
|
||||
//now redirect the post to modules/Accounts/ShowDuplicates.php
|
||||
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1')
|
||||
{
|
||||
ob_clean();
|
||||
$json = getJSONobj();
|
||||
echo $json->encode(array('status' => 'dupe', 'get' => $location));
|
||||
}
|
||||
else if(!empty($_REQUEST['ajax_load']))
|
||||
{
|
||||
echo "<script>SUGAR.ajaxUI.loadContent('index.php?$location');</script>";
|
||||
}
|
||||
else {
|
||||
if(!empty($_POST['to_pdf']))
|
||||
$location .= '&to_pdf='.$_POST['to_pdf'];
|
||||
echo '1';
|
||||
return '';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if(!$focus->ACLAccess('Save')){
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
if($focus->ks_account==''){
|
||||
$zap=$GLOBALS['db']->query('select ks_account from accounts where deleted=0 and invoice_type="'.$focus->invoice_type.'" order by ks_account desc limit 1');
|
||||
$wyn=$GLOBALS['db']->fetchByAssoc($zap);
|
||||
$focus->ks_account= (((int)$wyn['ks_account'])+1);
|
||||
if($focus->invoice_type=='K'){
|
||||
$focus->ks_account= sprintf('%04d', $focus->ks_account);
|
||||
}
|
||||
if($focus->invoice_type=='U'){
|
||||
$focus->ks_account= sprintf('%03d', $focus->ks_account);
|
||||
}
|
||||
if($focus->invoice_type=='E'){
|
||||
$focus->ks_account= sprintf('%03d', $focus->ks_account);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$focus->to_vatid_unformated = str_replace("-","", $focus->to_vatid);
|
||||
$focus->save($check_notify);
|
||||
$return_id = $focus->id;
|
||||
|
||||
//save addresses
|
||||
$focus->savePositions($_POST['position_list']);
|
||||
//save discounts
|
||||
$focus->savePositions2($_POST['position_list2']);
|
||||
//save categories
|
||||
$focus->savePositions3($_POST['position_list3']);
|
||||
//save banks
|
||||
$focus->savePositions4($_POST['position_list4']);
|
||||
|
||||
|
||||
$focus->saveWebSitesList($_POST['websites']);
|
||||
|
||||
$focus->saveTelephonesList($_POST['telephones']);
|
||||
$GLOBALS['log']->debug("Saved record with id of ".$return_id);
|
||||
|
||||
|
||||
if (!empty($_POST['is_ajax_call']) && $_POST['is_ajax_call'] == '1') {
|
||||
$json = getJSONobj();
|
||||
echo $json->encode(array('status' => 'success',
|
||||
'get' => ''));
|
||||
$trackerManager = TrackerManager::getInstance();
|
||||
$timeStamp = TimeDate::getInstance()->nowDb();
|
||||
if($monitor = $trackerManager->getMonitor('tracker')){
|
||||
$monitor->setValue('action', 'detailview');
|
||||
$monitor->setValue('user_id', $GLOBALS['current_user']->id);
|
||||
$monitor->setValue('module_name', 'Accounts');
|
||||
$monitor->setValue('date_modified', $timeStamp);
|
||||
$monitor->setValue('visible', 1);
|
||||
|
||||
if (!empty($this->bean->id)) {
|
||||
$monitor->setValue('item_id', $return_id);
|
||||
$monitor->setValue('item_summary', $focus->get_summary_text());
|
||||
}
|
||||
$trackerManager->saveMonitor($monitor, true, true);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if(isset($_POST['popup']) && $_POST['popup'] == 'true') {
|
||||
$get = '&module=';
|
||||
if(!empty($_POST['return_module'])) $get .= $_POST['return_module'];
|
||||
else $get .= 'Accounts';
|
||||
$get .= '&action=';
|
||||
if(!empty($_POST['return_action'])) $get .= $_POST['return_action'];
|
||||
else $get .= 'Popup';
|
||||
if(!empty($_POST['return_id'])) $get .= '&return_id='.$_POST['return_id'];
|
||||
if(!empty($_POST['popup'])) $get .= '&popup='.$_POST['popup'];
|
||||
if(!empty($_POST['create'])) $get .= '&create='.$_POST['create'];
|
||||
if(!empty($_POST['to_pdf'])) $get .= '&to_pdf='.$_POST['to_pdf'];
|
||||
$get .= '&name=' . $focus->name;
|
||||
$get .= '&query=true';
|
||||
header("Location: index.php?$get");
|
||||
return;
|
||||
}
|
||||
if($redirect){
|
||||
handleRedirect($return_id,'Accounts');
|
||||
}else{
|
||||
return $focus;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
69
modules/Accounts/AccountsQuickCreate.php
Normal file
69
modules/Accounts/AccountsQuickCreate.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/EditView/QuickCreate.php');
|
||||
|
||||
|
||||
|
||||
class AccountsQuickCreate extends QuickCreate {
|
||||
|
||||
var $javascript;
|
||||
|
||||
function process() {
|
||||
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
|
||||
$mod_strings = return_module_language($current_language, 'Accounts');
|
||||
|
||||
parent::process();
|
||||
|
||||
if($this->viaAJAX) { // override for ajax call
|
||||
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"accountsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"accounts\"); else return false;'");
|
||||
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_accounts\")';");
|
||||
}
|
||||
|
||||
$this->ss->assign('viaAJAX', $this->viaAJAX);
|
||||
|
||||
$this->javascript = new javascript();
|
||||
$this->javascript->setFormName('accountsQuickCreate');
|
||||
|
||||
$focus = new Account();
|
||||
$this->javascript->setSugarBean($focus);
|
||||
$this->javascript->addAllFields('');
|
||||
|
||||
$this->ss->assign('additionalScripts', $this->javascript->getScript(false));
|
||||
}
|
||||
}
|
||||
?>
|
||||
9
modules/Accounts/AddGoogleContact.php
Normal file
9
modules/Accounts/AddGoogleContact.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
if (!$_REQUEST['record'] || $_REQUEST['record']=='') {
|
||||
echo '5'; return;
|
||||
}
|
||||
|
||||
$a = new Account();
|
||||
$a->retrieve($_REQUEST['record']);
|
||||
echo $a->AddGoogleContact();
|
||||
return;
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
global $current_user;
|
||||
|
||||
$dashletData['MyAccountsDashlet']['searchFields'] = array('date_entered' => array('default' => ''),
|
||||
'account_type' => array('default' => ''),
|
||||
'industry' => array('default' => ''),
|
||||
'billing_address_country' => array('default'=>''),
|
||||
'assigned_user_id' => array('type' => 'assigned_user_name',
|
||||
'default' => $current_user->name,
|
||||
'label' => 'LBL_ASSIGNED_TO'));
|
||||
$dashletData['MyAccountsDashlet']['columns'] = array('name' => array('width' => '40',
|
||||
'label' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'link' => true,
|
||||
'default' => true),
|
||||
'website' => array('width' => '8',
|
||||
'label' => 'LBL_WEBSITE',
|
||||
'default' => true),
|
||||
'phone_office' => array('width' => '15',
|
||||
'label' => 'LBL_LIST_PHONE',
|
||||
'default' => true),
|
||||
'phone_fax' => array('width' => '8',
|
||||
'label' => 'LBL_PHONE_FAX'),
|
||||
'phone_alternate' => array('width' => '8',
|
||||
'label' => 'LBL_OTHER_PHONE'),
|
||||
'billing_address_city' => array('width' => '8',
|
||||
'label' => 'LBL_BILLING_ADDRESS_CITY'),
|
||||
'billing_address_street' => array('width' => '8',
|
||||
'label' => 'LBL_BILLING_ADDRESS_STREET'),
|
||||
'billing_address_state' => array('width' => '8',
|
||||
'label' => 'LBL_BILLING_ADDRESS_STATE'),
|
||||
'billing_address_postalcode' => array('width' => '8',
|
||||
'label' => 'LBL_BILLING_ADDRESS_POSTALCODE'),
|
||||
'billing_address_country' => array('width' => '8',
|
||||
'label' => 'LBL_BILLING_ADDRESS_COUNTRY',
|
||||
'default' => true),
|
||||
'register_address_city' => array('width' => '8',
|
||||
'label' => 'LBL_REGISTER_ADDRESS_CITY'),
|
||||
'register_address_street' => array('width' => '8',
|
||||
'label' => 'LBL_REGISTER_ADDRESS_STREET'),
|
||||
'register_address_state' => array('width' => '8',
|
||||
'label' => 'LBL_REGISTER_ADDRESS_STATE'),
|
||||
'register_address_postalcode' => array('width' => '8',
|
||||
'label' => 'LBL_REGISTER_ADDRESS_POSTALCODE'),
|
||||
'register_address_country' => array('width' => '8',
|
||||
'label' => 'LBL_REGISTER_ADDRESS_COUNTRY'),
|
||||
'email1' => array('width' => '8',
|
||||
'label' => 'LBL_EMAIL_ADDRESS_PRIMARY'),
|
||||
'account_name' => array('width' => '15',
|
||||
'label' => 'LBL_MEMBER_OF',
|
||||
'sortable' => false),
|
||||
'date_entered' => array('width' => '15',
|
||||
'label' => 'LBL_DATE_ENTERED'),
|
||||
'date_modified' => array('width' => '15',
|
||||
'label' => 'LBL_DATE_MODIFIED'),
|
||||
'created_by' => array('width' => '8',
|
||||
'label' => 'LBL_CREATED'),
|
||||
'assigned_user_name' => array('width' => '8',
|
||||
'label' => 'LBL_LIST_ASSIGNED_USER'),
|
||||
);
|
||||
?>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
global $app_strings;
|
||||
|
||||
$dashletMeta['MyAccountsDashlet'] = array('module' => 'Accounts',
|
||||
'title' => translate('LBL_HOMEPAGE_TITLE', 'Accounts'),
|
||||
'description' => 'A customizable view into Accounts',
|
||||
'category' => 'Module Views');
|
||||
?>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
require_once('include/Dashlets/DashletGeneric.php');
|
||||
|
||||
|
||||
class MyAccountsDashlet extends DashletGeneric {
|
||||
function MyAccountsDashlet($id, $def = null) {
|
||||
global $current_user, $app_strings;
|
||||
require('modules/Accounts/Dashlets/MyAccountsDashlet/MyAccountsDashlet.data.php');
|
||||
|
||||
parent::DashletGeneric($id, $def);
|
||||
|
||||
if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'Accounts');
|
||||
|
||||
$this->searchFields = $dashletData['MyAccountsDashlet']['searchFields'];
|
||||
$this->columns = $dashletData['MyAccountsDashlet']['columns'];
|
||||
|
||||
$this->seedBean = new Account();
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides the generic process to include custom logic for email addresses,
|
||||
* since they are no longer stored in a list view friendly manner.
|
||||
* (A record may have an undetermined number of email addresses).
|
||||
*
|
||||
* @param array $lvsParams
|
||||
*/
|
||||
|
||||
function process($lvsParams = array()) {
|
||||
if (isset($this->displayColumns) && array_search('email1', $this->displayColumns) !== false) {
|
||||
$lvsParams['custom_select'] = ', email_address as email1';
|
||||
$lvsParams['custom_from'] = "LEFT JOIN email_addr_bean_rel eabr ON eabr.deleted = 0 AND bean_module = 'Accounts' "
|
||||
. "AND eabr.bean_id = accounts.id AND primary_address = 1 "
|
||||
. "LEFT JOIN email_addresses ea ON ea.deleted = 0 AND ea.id = eabr.email_address_id";
|
||||
}
|
||||
parent::process($lvsParams);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
81
modules/Accounts/EditView.php
Normal file
81
modules/Accounts/EditView.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
$pl = $this->bean->getPositionList();
|
||||
$this->ss->assign('POSITION_LIST', $pl);
|
||||
|
||||
$pl2 = $this->bean->getPositionList2();
|
||||
$this->ss->assign('POSITION_LIST2', $pl2);
|
||||
|
||||
$pl3 = $this->bean->getPositionList3();
|
||||
$this->ss->assign('POSITION_LIST3', $pl3);
|
||||
|
||||
$pl4 = $this->bean->getPositionList4();
|
||||
$this->ss->assign('POSITION_LIST4', $pl4);
|
||||
|
||||
$ws = $this->bean->getWebSitesList();
|
||||
$this->ss->assign('WEBSITES_LIST', $ws);
|
||||
|
||||
$ws2 = $this->bean->getTelephonesList();
|
||||
$this->ss->assign('TELEPHONES_LIST', $ws2);
|
||||
//$this->ss->assign('WEBSITES_LIST', 'Websites.tpl');
|
||||
|
||||
global $mod_strings;
|
||||
$json = getJSONobj();
|
||||
|
||||
//opt
|
||||
$file = 'modules/EcmGroupSales/EcmGroupSale.php';
|
||||
if(file_exists($file)) {
|
||||
$cc = array();
|
||||
require_once($file);
|
||||
$cc = EcmGroupSale::loadSettings();
|
||||
}
|
||||
|
||||
$OPT = array();
|
||||
$OPT['row_item_height'] = $cc['row_item_height'];
|
||||
$OPT['row_item_height_selected'] = $cc['row_item_height_selected'];
|
||||
$OPT['rows_on_item_list'] = $cc['rows_on_item_list'];
|
||||
$OPT['position_table_height'] = $OPT['row_item_height']*$OPT['rows_on_item_list']+40+$OPT['rows_on_item_list']*4;
|
||||
$OPT['quick_product_item_adding'] = $cc['quick_product_item_adding'];
|
||||
|
||||
|
||||
if ($_REQUEST['IamPopup'])
|
||||
$OPT['IamPopup'] = '1';
|
||||
|
||||
global $current_user;
|
||||
|
||||
$tmp = $current_user->getPreference('num_grp_sep');
|
||||
if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_number_grouping_seperator'];
|
||||
$OPT['sep_1000'] = $tmp;
|
||||
|
||||
$tmp = $current_user->getPreference('dec_sep');
|
||||
if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_decimal_seperator'];
|
||||
$OPT['dec_sep'] = $tmp;
|
||||
|
||||
$tmp = $current_user->getPreference('default_currency_significant_digits');
|
||||
if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_currency_significant_digits'];
|
||||
$OPT['dec_len'] = $tmp;
|
||||
|
||||
echo '
|
||||
<script language="javascript">
|
||||
var OPT = '.str_replace('"','\"',$json->encode($OPT)).';
|
||||
var MOD = '.str_replace('"','\"',$json->encode($mod_strings)).';
|
||||
|
||||
</script>';
|
||||
|
||||
require_once('modules/EcmSysInfos/EcmSysInfo.php');
|
||||
$EcmSysInfo = new EcmSysInfo();
|
||||
$lista = $EcmSysInfo->getBankAccoutnsList();
|
||||
$bacc = '<select id="bankaccounts" onchange="$(\'#invoice_bank_account\').val(this.value)">';
|
||||
foreach ($lista as $ba) {
|
||||
$bacc.='<option value="'.$ba.'"';
|
||||
if ($ba == $this->bean->invoice_bank_account) $bacc.=' selected ';
|
||||
$bacc.=' >'.$ba.'</option>';
|
||||
}
|
||||
$bacc.='<input type="hidden" id="invoice_bank_account" name="invoice_bank_account" value="'.$this->bean->invoice_bank_account.'"/>';
|
||||
$this->ss->assign('BANKACCOUNTS', $bacc);
|
||||
|
||||
global $app_strings;
|
||||
$this->ss->assign('LBL_SAVE', $app_strings['LBL_SAVE_BUTTON_LABEL']);
|
||||
|
||||
//loading view
|
||||
echo '<link rel="stylesheet" type="text/css" href="modules/EcmInvoiceOuts/javascript/helper.css" media="screen" /><div class="loading_panel"></div>';
|
||||
52
modules/Accounts/Menu.php
Normal file
52
modules/Accounts/Menu.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: TODO To be written.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
global $mod_strings, $app_strings, $sugar_config;
|
||||
|
||||
|
||||
if(ACLController::checkAccess('Accounts', 'edit', true))$module_menu[]=Array("index.php?module=Accounts&action=EditView&return_module=Accounts&return_action=index", $mod_strings['LNK_NEW_ACCOUNT'],"CreateAccounts", 'Accounts');
|
||||
|
||||
if(ACLController::checkAccess('Accounts', 'list', true))$module_menu[]=Array("index.php?module=Accounts&action=index&return_module=Accounts&return_action=DetailView", $mod_strings['LNK_ACCOUNT_LIST'],"Accounts", 'Accounts');
|
||||
|
||||
?>
|
||||
109
modules/Accounts/Save.php
Normal file
109
modules/Accounts/Save.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: Saves an Account record and then redirects the browser to the
|
||||
* defined return URL.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
$json = getJSONobj();
|
||||
|
||||
$pll = array();
|
||||
$exp=explode("||||",$_POST['position_list']);
|
||||
foreach($exp as $ep){
|
||||
if($ep){
|
||||
$pll[] = $json->decode(htmlspecialchars_decode($ep));
|
||||
}
|
||||
}
|
||||
$_POST['position_list'] = $pll;
|
||||
|
||||
$pll = array();
|
||||
|
||||
$exp=explode("||||",$_POST['position_list2']);
|
||||
foreach($exp as $ep){
|
||||
if($ep){
|
||||
$pll[] = $json->decode(htmlspecialchars_decode($ep));
|
||||
}
|
||||
}
|
||||
$_POST['position_list2'] = $pll;
|
||||
|
||||
//categories
|
||||
$pll = array();
|
||||
$exp=explode("||||",$_POST['position_list3']);
|
||||
foreach($exp as $ep){
|
||||
if($ep){
|
||||
$pll[] = $json->decode(htmlspecialchars_decode($ep));
|
||||
}
|
||||
}
|
||||
$_POST['position_list3'] = $pll;
|
||||
//konta bankowe
|
||||
$pll = array();
|
||||
$exp=explode("||||",$_POST['position_list4']);
|
||||
foreach($exp as $ep){
|
||||
if($ep){
|
||||
$pll[] = $json->decode(htmlspecialchars_decode($ep));
|
||||
}
|
||||
}
|
||||
$_POST['position_list4'] = $pll;
|
||||
// web sites
|
||||
$pll = array();
|
||||
foreach($_POST['websites'] as $key=>$value){
|
||||
$pll[$key]['id'] = $_POST['websites_id'][$key];
|
||||
$pll[$key]['www'] = $_POST['websites'][$key];
|
||||
}
|
||||
$_POST['websites'] = $pll;
|
||||
|
||||
$pll = array();
|
||||
|
||||
foreach($_POST['telephones'] as $key=>$value){
|
||||
$pll[$key]['id'] = $_POST['telephones_id'][$key];
|
||||
$pll[$key]['telephone'] = $_POST['telephones'][$key];
|
||||
}
|
||||
$_POST['telephones'] = $pll;
|
||||
|
||||
require_once('modules/Accounts/AccountFormBase.php');
|
||||
$accountForm = new AccountFormBase();
|
||||
$prefix = empty($_REQUEST['dup_checked']) ? '' : 'Accounts';
|
||||
$a = $accountForm->handleSave($prefix, false, false);
|
||||
if($a->id!=''){
|
||||
echo $a->id;
|
||||
}
|
||||
return;
|
||||
?>
|
||||
59
modules/Accounts/SendEmail.php
Normal file
59
modules/Accounts/SendEmail.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
if (!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
if(!isset($_REQUEST['uid']))
|
||||
die('Nie wybrano kontrahentów');
|
||||
|
||||
$accounts=explode(",",$_REQUEST['uid']);
|
||||
$account_list=array();
|
||||
$emails;
|
||||
$error=0;
|
||||
|
||||
foreach ($accounts as $account){
|
||||
$ac= new Account();
|
||||
$ac->retrieve($account);
|
||||
if($ac->id=='')continue;
|
||||
$addTmp=array();
|
||||
$addTmp['name']=$ac->name;
|
||||
|
||||
$sea = new SugarEmailAddress();
|
||||
$addresses = $sea->getAddressesByGUID($ac->id, 'Accounts');
|
||||
foreach ($addresses as $address) {
|
||||
|
||||
if ($address['email_address'] != '' && $address['opt_out'] == 1) {
|
||||
$emails[]=$address['email_address'];
|
||||
$addTmp['emails'][]= $address['email_address'];
|
||||
}
|
||||
}
|
||||
$account_list[]=$addTmp;
|
||||
}
|
||||
$success='';
|
||||
if(isset($_POST['submit'])){
|
||||
if($_POST['body']!='' && $_POST['title']!='' && $_POST['uid']!=''){
|
||||
require_once 'include/ECM/EcmSendPdfButton/EcmSendPdfButton.inc';
|
||||
$t = new EcmSendPdfButton('Users', $usr_id,$itemail,$type);
|
||||
foreach ($emails as $email){
|
||||
$t->setBcc($email);
|
||||
}
|
||||
$t->setSubject($_REQUEST['title']);
|
||||
$t->setBody($_REQUEST['body']);
|
||||
$success = 0;
|
||||
$success= $t->sendEmail();
|
||||
|
||||
|
||||
} else {
|
||||
$error=1;
|
||||
}
|
||||
}
|
||||
$ss = new Sugar_Smarty();
|
||||
$ss->assign('uid',$_REQUEST['uid']);
|
||||
$ss->assign('body',$_REQUEST['body']);
|
||||
$ss->assign('error',$error);
|
||||
$ss->assign('success',$success);
|
||||
$ss->assign('title',$_REQUEST['title']);
|
||||
$ss->assign('account_list',$account_list);
|
||||
$content = $ss->fetch('modules/Accounts/tpls/SendEmail.tpl');
|
||||
|
||||
|
||||
echo $content;
|
||||
?>
|
||||
147
modules/Accounts/ShowDuplicates.php
Normal file
147
modules/Accounts/ShowDuplicates.php
Normal file
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
// retrieve $_POST values out of the $_SESSION variable - placed in there by AccountFormBase to avoid the length limitations on URLs implicit with GETS
|
||||
//$GLOBALS['log']->debug('ShowDuplicates.php: _POST = '.print_r($_SESSION['SHOW_DUPLICATES'],true));
|
||||
parse_str($_SESSION['SHOW_DUPLICATES'],$_POST);
|
||||
unset($_SESSION['SHOW_DUPLICATES']);
|
||||
//$GLOBALS['log']->debug('ShowDuplicates.php: _POST = '.print_r($_POST,true));
|
||||
|
||||
global $app_strings;
|
||||
global $app_list_strings;
|
||||
|
||||
$error_msg = '';
|
||||
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, 'Accounts');
|
||||
echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'].": ".$mod_strings['LBL_SAVE_ACCOUNT'], true);
|
||||
$xtpl=new XTemplate ('modules/Accounts/ShowDuplicates.html');
|
||||
$xtpl->assign("MOD", $mod_strings);
|
||||
$xtpl->assign("APP", $app_strings);
|
||||
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
|
||||
$xtpl->assign("MODULE", $_REQUEST['module']);
|
||||
if ($error_msg != '')
|
||||
{
|
||||
$xtpl->assign("ERROR", $error_msg);
|
||||
$xtpl->parse("main.error");
|
||||
}
|
||||
|
||||
if((isset($_REQUEST['popup']) && $_REQUEST['popup'] == 'true') ||(isset($_POST['popup']) && $_POST['popup']==true)) insert_popup_header($theme);
|
||||
|
||||
|
||||
$account = new Account();
|
||||
require_once('modules/Accounts/AccountFormBase.php');
|
||||
$accountForm = new AccountFormBase();
|
||||
$GLOBALS['check_notify'] = FALSE;
|
||||
|
||||
$query = 'select id, name, website, billing_address_city from accounts where deleted=0 ';
|
||||
$duplicates = $_POST['duplicate'];
|
||||
$count = count($duplicates);
|
||||
if ($count > 0)
|
||||
{
|
||||
$query .= "and (";
|
||||
$first = true;
|
||||
foreach ($duplicates as $duplicate_id)
|
||||
{
|
||||
if (!$first) $query .= ' OR ';
|
||||
$first = false;
|
||||
$query .= "id='$duplicate_id' ";
|
||||
}
|
||||
$query .= ')';
|
||||
}
|
||||
|
||||
$duplicateAccounts = array();
|
||||
|
||||
$db = DBManagerFactory::getInstance();
|
||||
$result = $db->query($query);
|
||||
$i=-1;
|
||||
while(($row=$db->fetchByAssoc($result)) != null) {
|
||||
$i++;
|
||||
$duplicateAccounts[$i] = $row;
|
||||
}
|
||||
|
||||
$xtpl->assign('FORMBODY', $accountForm->buildTableForm($duplicateAccounts, 'Accounts'));
|
||||
|
||||
$input = '';
|
||||
foreach ($account->column_fields as $field)
|
||||
{
|
||||
if (!empty($_POST['Accounts'.$field])) {
|
||||
$value = urldecode($_POST['Accounts'.$field]);
|
||||
$input .= "<input type='hidden' name='$field' value='{$value}'>\n";
|
||||
}
|
||||
}
|
||||
foreach ($account->additional_column_fields as $field)
|
||||
{
|
||||
if (!empty($_POST['Accounts'.$field])) {
|
||||
$value = urldecode($_POST['Accounts'.$field]);
|
||||
$input .= "<input type='hidden' name='$field' value='{$value}'>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$emailAddress = new SugarEmailAddress();
|
||||
$input .= $emailAddress->getEmailAddressWidgetDuplicatesView($account);
|
||||
|
||||
$get = '';
|
||||
if(!empty($_POST['return_module'])) $xtpl->assign('RETURN_MODULE', $_POST['return_module']);
|
||||
else $get .= "Accounts";
|
||||
$get .= "&return_action=";
|
||||
if(!empty($_POST['return_action'])) $xtpl->assign('RETURN_ACTION', $_POST['return_action']);
|
||||
else $get .= "DetailView";
|
||||
if(!empty($_POST['return_id'])) $xtpl->assign('RETURN_ID', $_POST['return_id']);
|
||||
|
||||
if(!empty($_POST['popup']))
|
||||
$input .= '<input type="hidden" name="popup" value="'.$_POST['popup'].'">';
|
||||
else
|
||||
$input .= '<input type="hidden" name="popup" value="false">';
|
||||
|
||||
if(!empty($_POST['to_pdf']))
|
||||
$input .= '<input type="hidden" name="to_pdf" value="'.$_POST['to_pdf'].'">';
|
||||
else
|
||||
$input .= '<input type="hidden" name="to_pdf" value="false">';
|
||||
|
||||
if(!empty($_POST['create']))
|
||||
$input .= '<input type="hidden" name="create" value="'.$_POST['create'].'">';
|
||||
else
|
||||
$input .= '<input type="hidden" name="create" value="false">';
|
||||
|
||||
$xtpl->assign('INPUT_FIELDS',$input);
|
||||
$xtpl->parse('main');
|
||||
$xtpl->out('main');
|
||||
|
||||
|
||||
?>
|
||||
11
modules/Accounts/checkNIP.php
Normal file
11
modules/Accounts/checkNIP.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if (!$_REQUEST['nip'] || trim($_REQUEST['nip'])=="") return;
|
||||
|
||||
$nip = trim($_REQUEST['nip']);
|
||||
$unip = str_replace('-', '', trim($_REQUEST['nip']));
|
||||
|
||||
$db = $GLOBALS['db'];
|
||||
|
||||
$r = $db->query("SELECT id FROM accounts WHERE to_vatid='$nip' OR to_vatid_unformated='$unip' AND deleted='0'");
|
||||
echo $r->num_rows;
|
||||
return;
|
||||
145
modules/Accounts/ee.php
Normal file
145
modules/Accounts/ee.php
Normal file
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
ini_set('display_errors',1);
|
||||
require_once 'include/ECM/GusApiSugar/vendor/autoload.php';
|
||||
|
||||
use GusApi\GusApi;
|
||||
use GusApi\RegonConstantsInterface;
|
||||
use GusApi\Exception\InvalidUserKeyException;
|
||||
use GusApi\ReportTypes;
|
||||
|
||||
class GusApiSugar
|
||||
{
|
||||
|
||||
private $key = 'eb11f76c0aee4c6e8501';
|
||||
|
||||
private $gus;
|
||||
|
||||
private $cuser;
|
||||
|
||||
private $array = null;
|
||||
|
||||
public function __construct ()
|
||||
{
|
||||
$this->gus = new GusApi($this->key,
|
||||
new \GusApi\Adapter\Soap\SoapAdapter(
|
||||
RegonConstantsInterface::BASE_WSDL_URL,
|
||||
RegonConstantsInterface::BASE_WSDL_ADDRESS));
|
||||
global $current_user;
|
||||
$this->cuser = $current_user;
|
||||
}
|
||||
|
||||
public function validate ($code)
|
||||
{
|
||||
$_SESSION['checkedgus'] = $this->gus->checkCaptcha($_SESSION['sigusd'],
|
||||
$code);
|
||||
var_dump($_SESSION['checkedgus']);
|
||||
}
|
||||
|
||||
public function getRaport ($gusReport)
|
||||
{
|
||||
if ($gusReport->type == 'f') {
|
||||
$nr = null;
|
||||
|
||||
foreach ($gusReport->silo as $val) {
|
||||
if ($val != '') {
|
||||
$nr = $val;
|
||||
}
|
||||
}
|
||||
switch ($nr) {
|
||||
case 0:
|
||||
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
|
||||
ReportTypes::REPORT_ACTIVITY_PHYSIC_PERSON);
|
||||
break;
|
||||
case 1:
|
||||
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
|
||||
ReportTypes::REPORT_ACTIVITY_PHYSIC_CEGID);
|
||||
break;
|
||||
case 2:
|
||||
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
|
||||
ReportTypes::REPORT_ACTIVITY_PHYSIC_AGRO);
|
||||
break;
|
||||
case 3:
|
||||
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
|
||||
ReportTypes::REPORT_ACTIVITY_PHYSIC_OTHER_PUBLIC);
|
||||
break;
|
||||
case 4:
|
||||
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
|
||||
ReportTypes::REPORT_ACTIVITY_LOCAL_PHYSIC_WKR_PUBLIC);
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
return $this->gus->getFullReport($_SESSION['sid'], $gusReport,
|
||||
ReportTypes::REPORT_PUBLIC_LAW);
|
||||
}
|
||||
}
|
||||
|
||||
public function getData ($nip)
|
||||
{
|
||||
$array = null;
|
||||
try {
|
||||
$gusReport = $this->gus->getByNip($_SESSION['sigusd'], $nip);
|
||||
$array['type']=$gusReport->type;
|
||||
$array[] = $this->getRaport($gusReport);
|
||||
} catch (\GusApi\Exception\NotFoundException $e) {
|
||||
|
||||
$error = $this->gus->getResultSearchMessage();
|
||||
if ('Wymagane pobranie i sprawdzenie kodu Captcha' == $error) {
|
||||
$_SESSION['checkedgus'] = false;
|
||||
$_SESSION['sigusd'] = '';
|
||||
$this->doLogin();
|
||||
return;
|
||||
} else {
|
||||
return array(
|
||||
'error' => 'tak',
|
||||
$error
|
||||
);
|
||||
}
|
||||
}
|
||||
if($array==null){
|
||||
$this->doLogin();
|
||||
return;
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
|
||||
public function doLogin ($code = null, $img = null)
|
||||
{
|
||||
if ($this->gus->serviceStatus() ===
|
||||
RegonConstantsInterface::SERVICE_AVAILABLE) {
|
||||
if (! isset($_SESSION['sigusd']) ||
|
||||
! $this->gus->isLogged($_SESSION['sigusd'])) {
|
||||
$_SESSION['sigusd'] = $this->gus->login();
|
||||
$_SESSION['checkedgus'] = false;
|
||||
}
|
||||
|
||||
if (isset($img)) {
|
||||
$_SESSION['checkedgus'] = $this->gus->checkCaptcha($_SESSION['sigusd'],
|
||||
$img);
|
||||
}
|
||||
|
||||
if (! $_SESSION['checkedgus']) {
|
||||
|
||||
$image = fopen("upload/captcha" . $this->cuser->id . ".jpeg", 'w+');
|
||||
|
||||
$captcha = $this->gus->getCaptcha($_SESSION['sigusd']);
|
||||
fwrite($image, base64_decode($captcha));
|
||||
fclose($image);
|
||||
|
||||
return array(
|
||||
'cuserid' => $this->cuser->id
|
||||
);
|
||||
} else {
|
||||
return $this->getData($code);
|
||||
}
|
||||
} else {
|
||||
return array(
|
||||
'error' => 'tak'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
$g= new GusApiSugar();
|
||||
|
||||
$back=$g->doLogin('5030056367');
|
||||
?>
|
||||
93
modules/Accounts/field_arrays.php
Normal file
93
modules/Accounts/field_arrays.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: Contains field arrays that are used for caching
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
$fields_array['Account'] = array ('column_fields' => Array(
|
||||
"annual_revenue"
|
||||
,"billing_address_street"
|
||||
,"billing_address_city"
|
||||
,"billing_address_state"
|
||||
,"billing_address_postalcode"
|
||||
,"billing_address_country"
|
||||
,"date_entered"
|
||||
,"date_modified"
|
||||
,"modified_user_id"
|
||||
,"assigned_user_id"
|
||||
,"description"
|
||||
,"email1"
|
||||
,"email2"
|
||||
,"employees"
|
||||
,"id"
|
||||
,"industry"
|
||||
,"name"
|
||||
,"ownership"
|
||||
,"parent_id"
|
||||
,"phone_alternate"
|
||||
,"phone_fax"
|
||||
,"phone_office"
|
||||
,"rating"
|
||||
,"register_address_street"
|
||||
,"register_address_city"
|
||||
,"register_address_state"
|
||||
,"register_address_postalcode"
|
||||
,"register_address_country"
|
||||
,"sic_code"
|
||||
,"ticker_symbol"
|
||||
,"account_type"
|
||||
,"website"
|
||||
, "created_by"
|
||||
),
|
||||
'list_fields' => Array('id', 'name', 'website', 'phone_office', 'assigned_user_name', 'assigned_user_id'
|
||||
, 'billing_address_street'
|
||||
, 'billing_address_city'
|
||||
, 'billing_address_state'
|
||||
, 'billing_address_postalcode'
|
||||
, 'billing_address_country'
|
||||
, 'register_address_street'
|
||||
, 'register_address_city'
|
||||
, 'register_address_state'
|
||||
, 'register_address_postalcode'
|
||||
, 'register_address_country'
|
||||
),
|
||||
'required_fields' => array("name"=>1),
|
||||
);
|
||||
?>
|
||||
10
modules/Accounts/getAddress.php
Normal file
10
modules/Accounts/getAddress.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
include_once("modules/Accounts/Account.php");
|
||||
$a=new Account();
|
||||
if ($_GET['id']) {
|
||||
$id = $_GET['id'];
|
||||
|
||||
$json = getJSONobj();
|
||||
echo $json->encode($a->getAddress($id));
|
||||
} else echo 0;
|
||||
?>
|
||||
8
modules/Accounts/getAddresses.php
Normal file
8
modules/Accounts/getAddresses.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
include_once("modules/Accounts/Account.php");
|
||||
$a=new Account();
|
||||
if ($_GET['account_id']) {
|
||||
$account_id = $_GET['account_id'];
|
||||
echo $a->getAddresses($account_id);
|
||||
} else echo 0;
|
||||
?>
|
||||
235
modules/Accounts/language/en_us.lang.php
Normal file
235
modules/Accounts/language/en_us.lang.php
Normal file
@@ -0,0 +1,235 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* Description: Defines the English language pack for the base application.
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
$mod_strings = array (
|
||||
//add mz
|
||||
'LBL_VAT_PAYER' => 'Active VAT payer',
|
||||
'LBL_PAYMENT_METHOD' => 'Default payment method',
|
||||
'LBL_DAYS' => 'Payment days',
|
||||
'LBL_NIP_EXIST' => 'INFO: This VATID exist in Accounts database',
|
||||
'LBL_INVOICE_BANK_ACCOUNT' => 'Default bank account',
|
||||
'LBL_ASSIGNED_CATEGORIES' => 'Assigned categories',
|
||||
'LBL_STREET' => 'Street',
|
||||
'LBL_EMAIL_ADDRESS' => 'E-mail',
|
||||
'LBL_SHOP_PANEL' => 'Shop online',
|
||||
'LBL_SHOP_USER' => 'Shop user',
|
||||
'LBL_ECMCOMMUNE' =>"Commune",
|
||||
'LBL_PRICEBOOK' => 'Online Shop Pricebook',
|
||||
'LBL_ECMQUOTES_SUBPANEL_TITLE' => 'Quotes',
|
||||
'LBL_ECMSALES_SUBPANEL_TITLE' => 'Sales',
|
||||
'LBL_ECMINVOICEOUTS_SUBPANEL_TITLE' => 'Invoices',
|
||||
'LBL_PANEL_DELIVERY_ADDRESSES' => 'Delivery addresses',
|
||||
'LBL_ADDRESS_NAME' => 'Name',
|
||||
'LBL_ADDRESS_POSITION' => 'Pos.',
|
||||
'LBL_ADDRESS_STREET' => 'Street',
|
||||
'LBL_ADDRESS_CITY' => 'City',
|
||||
'LBL_ADDRESS_POSTALCODE' => 'Postalcode',
|
||||
'LBL_ADDRESS_COUNTRY' => 'Country',
|
||||
'LBL_ADDRESS_PHONE' => 'Phone',
|
||||
'LBL_ADDRESS_FAX' => 'Fax',
|
||||
'LBL_PAYMENTCONDITION_NAME' => 'Payment Conditions',
|
||||
'LBL_DELIVERYCONDITION_NAME' => 'Delivery Conditions',
|
||||
'LBL_PANEL_DISCOUNTS' => 'Discounts',
|
||||
'LBL_PRODUCT_GROUP' => 'Products group',
|
||||
'LBL_DISCOUNT' => 'Disciunt (%)',
|
||||
'LBL_TO_VATID' => 'VAT ID',
|
||||
'LBL_SUPPLIER_CODE' => 'Supplier code',
|
||||
'LBL_ILN' => 'Iln',
|
||||
'LBL_AUTO_INVOICE' => 'Auto invoice',
|
||||
'LBL_SAVE_TO_GOOGLE' => 'Save to my Google Contacts',
|
||||
'LBL_GOOGLE_ERROR' => 'No Google Account informations (See User pereferences)',
|
||||
'LBL_MAPS' => 'Maps',
|
||||
'LBL_CURRENCY' => 'Currency',
|
||||
'LBL_INVOICE_TYPE' => 'Invoice type',
|
||||
'LBL_PANEL_CATEGORIES' => 'Categories',
|
||||
'LBL_CATEGORY_NAME' => 'Category',
|
||||
'LBL_CATEGORY_ASSIGNED_FILE' => 'Assigned file',
|
||||
//end mz
|
||||
// DON'T CONVERT THESE THEY ARE MAPPINGS
|
||||
'db_name' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'db_website' => 'LBL_LIST_WEBSITE',
|
||||
'db_billing_address_city' => 'LBL_LIST_CITY',
|
||||
// END DON'T CONVERT
|
||||
'LBL_DOCUMENTS_SUBPANEL_TITLE' => 'Documents',
|
||||
// Dashlet Categories
|
||||
'LBL_CHARTS' => 'Charts',
|
||||
'LBL_DEFAULT' => 'Views',
|
||||
'LBL_MISC' => 'Misc',
|
||||
'LBL_UTILS' => 'Utils',
|
||||
// END Dashlet Categories
|
||||
|
||||
'ACCOUNT_REMOVE_PROJECT_CONFIRM' => 'Are you sure you want to remove this account from the project?',
|
||||
'ERR_DELETE_RECORD' => 'You must specify a record number in order to delete the account.',
|
||||
'LBL_ACCOUNT_INFORMATION' => 'Overview',
|
||||
'LBL_ACCOUNT_NAME' => 'Account Name:',
|
||||
'LBL_ACCOUNT' => 'Account:',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE'=>'Activities',
|
||||
'LBL_ADDRESS_INFORMATION' => 'Address Information',
|
||||
'LBL_ANNUAL_REVENUE' => 'Annual Revenue:',
|
||||
'LBL_ANY_ADDRESS' => 'Any Address:',
|
||||
'LBL_ANY_EMAIL' => 'Any Email:',
|
||||
'LBL_ANY_PHONE' => 'Any Phone:',
|
||||
'LBL_ASSIGNED_TO_NAME' => 'Assigned to:',
|
||||
'LBL_ASSIGNED_TO_ID' => 'Assigned User:',
|
||||
'LBL_BILLING_ADDRESS_CITY' => 'Billing City:',
|
||||
'LBL_BILLING_ADDRESS_COUNTRY' => 'Billing Country:',
|
||||
'LBL_BILLING_ADDRESS_POSTALCODE' => 'Billing Postal Code:',
|
||||
'LBL_BILLING_ADDRESS_STATE' => 'Billing State:',
|
||||
'LBL_BILLING_ADDRESS_STREET_2' =>'Billing Street 2',
|
||||
'LBL_BILLING_ADDRESS_STREET_3' =>'Billing Street 3',
|
||||
'LBL_BILLING_ADDRESS_STREET_4' =>'Billing Street 4',
|
||||
'LBL_BILLING_ADDRESS_STREET' => 'Billing Street:',
|
||||
'LBL_BILLING_ADDRESS' => 'Billing Address:',
|
||||
'LBL_BUG_FORM_TITLE' => 'Accounts',
|
||||
'LBL_BUGS_SUBPANEL_TITLE' => 'Bugs',
|
||||
'LBL_CALLS_SUBPANEL_TITLE' => 'Calls',
|
||||
'LBL_CAMPAIGN_ID' => 'Campaign ID',
|
||||
'LBL_CASES_SUBPANEL_TITLE' => 'Cases',
|
||||
'LBL_CITY' => 'City:',
|
||||
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Contacts',
|
||||
'LBL_COUNTRY' => 'Country:',
|
||||
'LBL_DATE_ENTERED' => 'Date Created:',
|
||||
'LBL_DATE_MODIFIED' => 'Date Modified:',
|
||||
'LBL_MODIFIED_ID'=>'Modified By Id',
|
||||
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Accounts',
|
||||
'LBL_DESCRIPTION_INFORMATION' => 'Description Information',
|
||||
'LBL_DESCRIPTION' => 'Description:',
|
||||
'LBL_DUPLICATE' => 'Possible Duplicate Account',
|
||||
'LBL_EMAIL' => 'Email Address:',
|
||||
'LBL_EMAIL_OPT_OUT' => 'Email Opt Out:',
|
||||
'LBL_EMAIL_ADDRESSES' => 'Email Addresses',
|
||||
'LBL_EMPLOYEES' => 'Employees:',
|
||||
'LBL_FAX' => 'Fax:',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE'=>'History',
|
||||
'LBL_HOMEPAGE_TITLE' => 'My Accounts',
|
||||
'LBL_INDUSTRY' => 'Industry:',
|
||||
'LBL_INVALID_EMAIL'=>'Invalid Email:',
|
||||
'LBL_INVITEE' => 'Contacts',
|
||||
'LBL_LEADS_SUBPANEL_TITLE' => 'Leads',
|
||||
'LBL_LIST_ACCOUNT_NAME' => 'Name',
|
||||
'LBL_LIST_CITY' => 'City',
|
||||
'LBL_LIST_CONTACT_NAME' => 'Contact Name',
|
||||
'LBL_LIST_EMAIL_ADDRESS' => 'Email Address',
|
||||
'LBL_LIST_FORM_TITLE' => 'Account List',
|
||||
'LBL_LIST_PHONE' => 'Phone',
|
||||
'LBL_LIST_STATE' => 'State',
|
||||
'LBL_LIST_WEBSITE' => 'Website',
|
||||
'LBL_MEETINGS_SUBPANEL_TITLE' => 'Meetings',
|
||||
'LBL_MEMBER_OF' => 'Member of:',
|
||||
'LBL_MEMBER_ORG_FORM_TITLE' => 'Member Organizations',
|
||||
'LBL_MEMBER_ORG_SUBPANEL_TITLE'=>'Member Organizations',
|
||||
'LBL_MODULE_NAME' => 'Accounts',
|
||||
'LBL_MODULE_TITLE' => 'Accounts: Home',
|
||||
'LBL_MODULE_ID'=> 'Accounts',
|
||||
'LBL_NAME'=>'Name:',
|
||||
'LBL_NEW_FORM_TITLE' => 'New Account',
|
||||
'LBL_OPPORTUNITIES_SUBPANEL_TITLE' => 'Opportunities',
|
||||
'LBL_OTHER_EMAIL_ADDRESS' => 'Other Email:',
|
||||
'LBL_OTHER_PHONE' => 'Other Phone:',
|
||||
'LBL_OWNERSHIP' => 'Ownership:',
|
||||
'LBL_PARENT_ACCOUNT_ID' => 'Parent Account ID',
|
||||
'LBL_PHONE_ALT' => 'Alternate Phone:',
|
||||
'LBL_PHONE_FAX' => 'Phone Fax:',
|
||||
'LBL_PHONE_OFFICE' => 'Office Phone:',
|
||||
'LBL_PHONE' => 'Phone:',
|
||||
'LBL_POSTAL_CODE' => 'Postal Code:',
|
||||
'LBL_PRODUCTS_TITLE'=>'Products',
|
||||
'LBL_PROJECTS_SUBPANEL_TITLE' => 'Projects',
|
||||
'LBL_PUSH_BILLING' => 'Push Billing',
|
||||
'LBL_PUSH_CONTACTS_BUTTON_LABEL' => 'Copy to Contacts',
|
||||
'LBL_PUSH_CONTACTS_BUTTON_TITLE' => 'Copy...',
|
||||
'LBL_PUSH_REGISTER' => 'Push Shipping',
|
||||
'LBL_RATING' => 'Rating:',
|
||||
'LBL_SAVE_ACCOUNT' => 'Save Account',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Account Search',
|
||||
'LBL_REGISTER_ADDRESS_CITY' => 'Shipping City:',
|
||||
'LBL_REGISTER_ADDRESS_COUNTRY' => 'Shipping Country:',
|
||||
'LBL_REGISTER_ADDRESS_POSTALCODE' => 'Shipping Postal Code:',
|
||||
'LBL_REGISTER_ADDRESS_STATE' => 'Shipping State:',
|
||||
'LBL_REGISTER_ADDRESS_STREET_2' => 'Shipping Street 2',
|
||||
'LBL_REGISTER_ADDRESS_STREET_3' => 'Shipping Street 3',
|
||||
'LBL_REGISTER_ADDRESS_STREET_4' => 'Shipping Street 4',
|
||||
'LBL_REGISTER_ADDRESS_STREET' => 'Shipping Street:',
|
||||
'LBL_REGISTER_ADDRESS' => 'Shipping Address:',
|
||||
'LBL_SIC_CODE' => 'SIC Code:',
|
||||
'LBL_STATE' => 'State:',
|
||||
'LBL_TASKS_SUBPANEL_TITLE' => 'Tasks',
|
||||
'LBL_TEAMS_LINK'=>'Teams',
|
||||
'LBL_TICKER_SYMBOL' => 'Ticker Symbol:',
|
||||
'LBL_TYPE' => 'Type:',
|
||||
'LBL_USERS_ASSIGNED_LINK'=>'Assigned Users',
|
||||
'LBL_USERS_CREATED_LINK'=>'Created By Users',
|
||||
'LBL_USERS_MODIFIED_LINK'=>'Modified Users',
|
||||
'LBL_VIEW_FORM_TITLE' => 'Account View',
|
||||
'LBL_WEBSITE' => 'Website:',
|
||||
'LBL_CREATED_ID'=>'Created By Id',
|
||||
'LBL_CAMPAIGNS' =>'Campaigns',
|
||||
'LNK_ACCOUNT_LIST' => 'View Accounts',
|
||||
'LNK_NEW_ACCOUNT' => 'Create Account',
|
||||
'LNK_IMPORT_ACCOUNTS' => 'Import Accounts',
|
||||
'MSG_DUPLICATE' => 'The account record you are about to create might be a duplicate of an account record that already exists. Account records containing similar names are listed below.<br>Click Create Account to continue creating this new account, or select an existing account listed below.',
|
||||
'MSG_SHOW_DUPLICATES' => 'The account record you are about to create might be a duplicate of an account record that already exists. Account records containing similar names are listed below.<br>Click Save to continue creating this new account, or click Cancel to return to the module without creating the account.',
|
||||
'NTC_COPY_BILLING_ADDRESS' => 'Copy billing address to register address',
|
||||
'NTC_COPY_BILLING_ADDRESS2' => 'Copy to register',
|
||||
'NTC_COPY_REGISTER_ADDRESS' => 'Copy register address to billing address',
|
||||
'NTC_COPY_REGISTER_ADDRESS2' => 'Copy to billing',
|
||||
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to delete this record?',
|
||||
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this record?',
|
||||
'NTC_REMOVE_MEMBER_ORG_CONFIRMATION' => 'Are you sure you want to remove this record as a member organization?',
|
||||
'LBL_ASSIGNED_USER_NAME' => 'Assigned to:',
|
||||
'LBL_PROSPECT_LIST' => 'Prospect List',
|
||||
'LBL_ACCOUNTS_SUBPANEL_TITLE'=>'Accounts',
|
||||
'LBL_PROJECT_SUBPANEL_TITLE' => 'Projects',
|
||||
'LBL_COPY' => 'Copy' /*for 508 compliance fix*/,
|
||||
//For export labels
|
||||
'LBL_ACCOUNT_TYPE' => 'Account Type',
|
||||
'LBL_CAMPAIGN_ID' => 'Campaign ID',
|
||||
'LBL_PARENT_ID' => 'Parent ID',
|
||||
'LBL_PHONE_ALTERNATE' => 'Phone Alternate',
|
||||
'LBL_EXPORT_ASSIGNED_USER_NAME' => 'Assigned User Name',
|
||||
// SNIP
|
||||
'LBL_CONTACT_HISTORY_SUBPANEL_TITLE' => 'Related Contacts\' Emails',
|
||||
);
|
||||
?>
|
||||
240
modules/Accounts/language/pl_pl.lang.php
Normal file
240
modules/Accounts/language/pl_pl.lang.php
Normal file
@@ -0,0 +1,240 @@
|
||||
<?php
|
||||
|
||||
if (!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
/* +******************************************************************************
|
||||
* Zasady użytkowania znajdują się na stronie: http://opensaas.pl/kontakt/regulamin.html
|
||||
* *******************************************************************************
|
||||
* Language : Język polski
|
||||
* Version : 6.5.x
|
||||
* Author : OpenSaaS Sp. z o.o.
|
||||
* Website : www.opensaas.pl
|
||||
* *****************************************************************************+ */
|
||||
|
||||
$mod_strings = array(
|
||||
'LBL_SALES_CHART_NAME' => 'Nazwa',
|
||||
'LBL_SALES_CHART_NETTO' => 'Sprzedaż',
|
||||
'LBL_SALES_CHART_BUY' => 'Zakup',
|
||||
'LBL_SALES_CHART_INCOME' => 'Dochód',
|
||||
'LBL_SALES_CHART_NARZUT' => 'Narzut',
|
||||
'LBL_SALES_CHART_INCOME_PERCENT' => 'Marża %',
|
||||
'LBL_SALES_CHART_NOPE' => 'Brak sprzedaży w ostatnim roku.',
|
||||
'LBL_SALES_CHART_SUMMARY' => 'Suma',
|
||||
'LBL_PANEL_SALES' => 'Wykres sprzedaży',
|
||||
'LBL_VAT_PAYER' => 'Czynny płatnik VAT',
|
||||
'LBL_PAYMENT_METHOD' => 'Forma płatności',
|
||||
'LBL_DAYS' => 'Liczba dni do płatności',
|
||||
'LBL_NIP_EXIST' => 'Informacja: Kontrahent o podanym numerze NIP istnieje w bazie danych',
|
||||
'LBL_INVOICE_BANK_ACCOUNT' => 'Domyślne konto bankowe',
|
||||
'LBL_SYNTHETICACCOUNTS' => 'Konto jakies tam',
|
||||
'HELP_LBL_SYNTHETICACCOUNTS_BUTTON' => 'Dodaj kolejne konto',
|
||||
'HELP_LBL_SYNTHETICACCOUNTS_BUTTONDEL' => 'Usuń',
|
||||
'LBL_WITHOUT_HISTORY' => 'Bez historii',
|
||||
'LBL_ADDRESS_NIP' =>'NIP',
|
||||
'LBL_ADDRESS_ILN'=>'ILN',
|
||||
//add mz
|
||||
'LBL_PANEL_DISCOUNTACCOUNT'=>'Upusty od obrotu',
|
||||
'LBL_ECMCOMMUNE' =>"Gmina",
|
||||
'LBL_REGISTER_COMMUNE' => 'Gmina',
|
||||
'LBL_ASSIGNED_CATEGORIES' => 'Przypisane kategorie',
|
||||
'LBL_STREET' => 'Ulica',
|
||||
'LBL_INDEX' => "Indeks",
|
||||
'LBL_PANEL_BANK_ACCOUNTS' => 'Konta Bankowe',
|
||||
'LBL_EMAIL_ADDRESS' => 'E-mail',
|
||||
'LBL_SHOP_PANEL' => 'Sklep online',
|
||||
'LBL_SHOP_USER' => 'Użytkownik online',
|
||||
'LBL_PRICEBOOK' => 'Cennik sklepu online',
|
||||
'LBL_ECMQUOTES_SUBPANEL_TITLE' => 'Oferty',
|
||||
'LBL_ECMSALES_SUBPANEL_TITLE' => 'Zamówienia Sprzedaży',
|
||||
'LBL_ECMINVOICEOUTS_SUBPANEL_TITLE' => 'Faktury',
|
||||
'LBL_PANEL_DELIVERY_ADDRESSES' => 'Adresy',
|
||||
'LBL_REGISTER_ADDRESS_LIST' => 'Adres',
|
||||
'LBL_ADDRESS_NAME' => 'Nazwa',
|
||||
'LBL_WEBSITE_NAME' => 'Strona WWW',
|
||||
'LBL_REGON' => 'Regon',
|
||||
'LBL_KRS' => 'KRS',
|
||||
'LBL_ADDRESS_POSITION' => 'Poz.',
|
||||
'LBL_ADDRESS_STREET' => 'Ulica',
|
||||
'LBL_ADDRESS_CITY' => 'Miasto',
|
||||
'LBL_ADDRESS_POSTALCODE' => 'Kod pocztowy',
|
||||
'LBL_ADDRESS_COUNTRY' => 'Kraj',
|
||||
'LBL_ADDRESS_PHONE' => 'Telefon',
|
||||
'LBL_ADDRESS_FAX' => 'Fax',
|
||||
'LBL_PAYMENTCONDITION_NAME' => 'Warunki płatności',
|
||||
'LBL_PAYMENTCONDITION_ID' => 'Warunki płatności',
|
||||
'LBL_DELIVERYCONDITION_NAME' => 'Warunki dostawy',
|
||||
'LBL_DELIVERYCONDITION_ID' => 'Warunki dostawy',
|
||||
'LBL_PANEL_DISCOUNTS' => 'Upusty',
|
||||
'LBL_PRODUCT_GROUP' => 'Grupa produktów',
|
||||
'LBL_DISCOUNT' => 'Upust (%)',
|
||||
'LBL_TO_VATID' => 'NIP',
|
||||
'LBL_SUPPLIER_CODE' => 'Kod dostawcy',
|
||||
'LBL_ILN' => 'Iln',
|
||||
'LBL_AUTO_INVOICE' => 'Automatycznie wystawiaj FV',
|
||||
'LBL_SAVE_TO_GOOGLE' => 'Zapisz w moich kontaktach Google',
|
||||
'LBL_GOOGLE_ERROR' => 'Brak informacji o koncie Google (Sprawdź ustawienia użytkownika)',
|
||||
'LBL_MAPS' => 'Mapy',
|
||||
'LBL_CURRENCY' => 'Waluta',
|
||||
'LBL_INVOICE_TYPE' => 'Typ faktury',
|
||||
'LBL_PANEL_CATEGORIES' => 'Kategoryzacja',
|
||||
'LBL_CATEGORY_NAME' => 'Nazwa kategori',
|
||||
'LBL_EDITTABLE_OPTIONS' => 'Opc.',
|
||||
'LBL_LIST_POSTALCODE' => 'Kod pocztowy',
|
||||
'LBL_CATEGORY_ASSIGNED_FILE' => 'Załącznik',
|
||||
//end mz
|
||||
// DON'T CONVERT THESE THEY ARE MAPPINGS
|
||||
'db_name' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'db_website' => 'LBL_LIST_WEBSITE',
|
||||
'db_billing_address_city' => 'LBL_LIST_CITY',
|
||||
// END DON'T CONVERT
|
||||
'LBL_DOCUMENTS_SUBPANEL_TITLE' => 'Dokumenty',
|
||||
'LBL_NATURAL_PERSON' => 'Osoba Fizyczna',
|
||||
// Dashlet Categories
|
||||
'LBL_CHARTS' => 'Wykresy',
|
||||
'LBL_TYPE_2' => 'Typ konrahenta',
|
||||
'LBL_DEFAULT' => 'Widoki',
|
||||
'LBL_MISC' => 'Inne',
|
||||
'LBL_UTILS' => 'Narzędzia',
|
||||
// END Dashlet Categories
|
||||
// BANK ACCOUNTS
|
||||
'LBL_BANK_POSITION' => 'Poz.',
|
||||
'LBL_BANK_NAME' => 'Nazwa',
|
||||
'LBL_BANK_ACCOUNT' => 'Numer konta',
|
||||
// END
|
||||
'ACCOUNT_REMOVE_PROJECT_CONFIRM' => 'Czy na pewno chcesz usunąć Kontrahenta z projektu?',
|
||||
'ERR_DELETE_RECORD' => 'Aby usunąć Kontrahenta musisz określić numer rekordu.',
|
||||
'LBL_ACCOUNT_INFORMATION' => 'Szczegóły Kontrahenta',
|
||||
'LBL_ACCOUNT_NAME' => 'Nazwa Kontrahenta:',
|
||||
'LBL_ACCOUNT' => 'Kontrahent:',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Wydarzenia',
|
||||
'LBL_ADDRESS_INFORMATION' => 'Informacje adresowe',
|
||||
'LBL_ANNUAL_REVENUE' => 'Roczne dochody:',
|
||||
'LBL_ANY_ADDRESS' => 'Dodatkowy Adres:',
|
||||
'LBL_ANY_EMAIL' => 'Email:',
|
||||
'LBL_ANY_PHONE' => 'Telefon:',
|
||||
'LBL_ASSIGNED_TO_NAME' => 'Przydzielony do:',
|
||||
'LBL_ASSIGNED_TO_ID' => 'Przypisany Użytkownik:',
|
||||
'LBL_BILLING_ADDRESS_CITY' => 'Adres korespondencyjny - Miasto:',
|
||||
'LBL_BILLING_ADDRESS_COUNTRY' => 'Adres korespondencyjny - Kraj:',
|
||||
'LBL_BILLING_ADDRESS_POSTALCODE' => 'Adres korespondencyjny - Kod pocztowy:',
|
||||
'LBL_BILLING_ADDRESS_STATE' => 'Adres korespondencyjny - Województwo:',
|
||||
'LBL_BILLING_ADDRESS_STREET_2' => 'Adres korespondencyjny - Ulica 2',
|
||||
'LBL_BILLING_ADDRESS_STREET_3' => 'Adres korespondencyjny - Ulica 3',
|
||||
'LBL_BILLING_ADDRESS_STREET_4' => 'Adres korespondencyjny - Ulica 4',
|
||||
'LBL_BILLING_ADDRESS_STREET' => 'Adres korespondencyjny - Ulica:',
|
||||
'LBL_BILLING_ADDRESS' => 'Adres korespondencyjny: <br><br><br>Gmina:',
|
||||
'LBL_BILLING_ADDRESS2' => 'Adres korespondencyjny:',
|
||||
'LBL_BUG_FORM_TITLE' => 'Kontrahenci',
|
||||
'LBL_BUGS_SUBPANEL_TITLE' => 'Błędy',
|
||||
'LBL_CALLS_SUBPANEL_TITLE' => 'Połączenia telefoniczne',
|
||||
'LBL_CAMPAIGN_ID' => 'ID Kampanii reklamowej',
|
||||
'LBL_CASES_SUBPANEL_TITLE' => 'Zgłoszenia',
|
||||
'LBL_CITY' => 'Miasto:',
|
||||
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Kontakty',
|
||||
'LBL_COUNTRY' => 'Kraj:',
|
||||
'LBL_DATE_ENTERED' => 'Data utworzenia:',
|
||||
'LBL_DATE_MODIFIED' => 'Data modyfikacji:',
|
||||
'LBL_MODIFIED_ID' => 'Zmodyfikowane przez: ',
|
||||
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Kontrahenci',
|
||||
'LBL_DESCRIPTION_INFORMATION' => 'Dodatkowe informacje',
|
||||
'LBL_DESCRIPTION' => 'Opis:',
|
||||
'LBL_DUPLICATE' => 'Znaleziono rekord o podobnych danych',
|
||||
'LBL_EMAIL' => 'E-mail:',
|
||||
'LBL_EMAIL_OPT_OUT' => 'Czy wyłączyć system powiadomień?',
|
||||
'LBL_EMAIL_ADDRESSES' => 'Adresy e-mail',
|
||||
'LBL_EMPLOYEES' => 'Liczba pracowników:',
|
||||
'LBL_FAX' => 'Fax:',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE' => 'Historia',
|
||||
'LBL_HOMEPAGE_TITLE' => 'Moi Kontrahenci',
|
||||
'LBL_INDUSTRY' => 'Branża:',
|
||||
'LBL_INVALID_EMAIL' => 'Niepoprawny adres email',
|
||||
'LBL_INVITEE' => 'Kontakty',
|
||||
'LBL_LEADS_SUBPANEL_TITLE' => 'Potencjalni Klienci',
|
||||
'LBL_LIST_ACCOUNT_NAME' => 'Nazwa Kontrahenta',
|
||||
'LBL_LIST_CITY' => 'Miasto',
|
||||
'LBL_LIST_CONTACT_NAME' => 'Nazwa kontaktu',
|
||||
'LBL_LIST_EMAIL_ADDRESS' => 'Adresy e-mail',
|
||||
'LBL_LIST_FORM_TITLE' => 'Lista Kontrahentów',
|
||||
'LBL_LIST_PHONE' => 'Telefon',
|
||||
'LBL_LIST_STATE' => 'Województwo',
|
||||
'LBL_LIST_WEBSITE' => 'Strona WWW',
|
||||
'LBL_MEETINGS_SUBPANEL_TITLE' => 'Spotkania',
|
||||
'LBL_MEMBER_OF' => 'Podlega pod:',
|
||||
'LBL_MEMBER_ORG_FORM_TITLE' => 'Organizacje członkowskie',
|
||||
'LBL_MEMBER_ORG_SUBPANEL_TITLE' => 'Członek organizacji',
|
||||
'LBL_MODULE_NAME' => 'Kontrahenci',
|
||||
'LBL_MODULE_TITLE' => 'Kontrahenci: Strona główna',
|
||||
'LBL_MODULE_ID' => 'Kontrahenci',
|
||||
'LBL_NAME' => 'Nazwa:',
|
||||
'LBL_NEW_FORM_TITLE' => 'Utwórz Kontrahenta',
|
||||
'LBL_OPPORTUNITIES_SUBPANEL_TITLE' => 'Szanse Sprzedaży',
|
||||
'LBL_OTHER_EMAIL_ADDRESS' => 'Dodatkowy adres email:',
|
||||
'LBL_OTHER_PHONE' => 'Dodatkowy numer telefonu:',
|
||||
'LBL_OWNERSHIP' => 'Właściciel:',
|
||||
'LBL_PARENT_ACCOUNT_ID' => 'ID Kontrahenta nadrzędnego',
|
||||
'LBL_PHONE_ALT' => 'Alternatywny telefon:',
|
||||
'LBL_PHONE_FAX' => 'Fax:',
|
||||
'LBL_PHONE_OFFICE' => 'Telefon:',
|
||||
'LBL_PHONE' => 'Telefon:',
|
||||
'LBL_POSTAL_CODE' => 'Kod pocztowy:',
|
||||
'LBL_PRODUCTS_TITLE' => 'Produkty',
|
||||
'LBL_PROJECTS_SUBPANEL_TITLE' => 'Projekty',
|
||||
'LBL_PUSH_BILLING' => 'Kopiuj adres korespond.',
|
||||
'LBL_PUSH_CONTACTS_BUTTON_LABEL' => 'Kopiuj do kontaktów',
|
||||
'LBL_PUSH_CONTACTS_BUTTON_TITLE' => 'Kopiuj...',
|
||||
'LBL_PUSH_REGISTER' => 'Kopiuj Adres rejestrowy',
|
||||
'LBL_RATING' => 'Ocena:',
|
||||
'LBL_SAVE_ACCOUNT' => 'Zapisz kontrahenta',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'Wyszukiwanie kontrahenta',
|
||||
'LBL_REGISTER_ADDRESS_CITY' => 'Adres rejestrowy - Miasto:',
|
||||
'LBL_REGISTER_ADDRESS_COUNTRY' => 'Adres rejestrowy - Kraj:',
|
||||
'LBL_REGISTER_ADDRESS_POSTALCODE' => 'Adres rejestrowy - Kod pocztowy:',
|
||||
'LBL_REGISTER_ADDRESS_STATE' => 'Adres rejestrowy - Województwo:',
|
||||
'LBL_REGISTER_ADDRESS_STREET_2' => 'Adres rejestrowy - Ulica 2',
|
||||
'LBL_REGISTER_ADDRESS_STREET_3' => 'Adres rejestrowy - Ulica 3',
|
||||
'LBL_REGISTER_ADDRESS_STREET_4' => 'Adres rejestrowy - Ulica 4',
|
||||
'LBL_REGISTER_ADDRESS_STREET' => 'Adres rejestrowy - Ulica:',
|
||||
'LBL_REGISTER_ADDRESS' => 'Adres rejestrowy:<br><br><br>Gmina:',
|
||||
'LBL_REGISTER_ADDRESS2' => 'Adres rejestrowy:',
|
||||
'LBL_SIC_CODE' => 'Kod GLN:',
|
||||
'LBL_STATE' => 'Województwo:',
|
||||
'LBL_TASKS_SUBPANEL_TITLE' => 'Zadania',
|
||||
'LBL_TEAMS_LINK' => 'Zespoły',
|
||||
'LBL_TICKER_SYMBOL' => 'Symbol giełdowy:',
|
||||
'LBL_TYPE' => 'Rodzaj Kontrahenta:',
|
||||
'LBL_USERS_ASSIGNED_LINK' => 'Przydzieleni użytkownicy',
|
||||
'LBL_USERS_CREATED_LINK' => 'Utworzone przez użytkowników',
|
||||
'LBL_USERS_MODIFIED_LINK' => 'Zmodyfikowane przez użytkowników',
|
||||
'LBL_VIEW_FORM_TITLE' => 'Podgląd Kontrahenta',
|
||||
'LBL_WEBSITE' => 'Strona WWW #1:',
|
||||
'LBL_WEBSITE2' => 'Strona WWW #2:',
|
||||
'LBL_WEBSITE3' => 'Strona WWW #3:',
|
||||
'LBL_CREATED_ID' => 'Utworzone przez',
|
||||
'LBL_CAMPAIGNS' => 'Kampanie reklamowe',
|
||||
'LNK_ACCOUNT_LIST' => 'Lista kontrahentów',
|
||||
'LNK_NEW_ACCOUNT' => 'Utwórz Kontrahenta',
|
||||
'LNK_IMPORT_ACCOUNTS' => 'Import Kontrahentów',
|
||||
'MSG_DUPLICATE' => 'Kontrahent o podobnych dany już istnieje w systemie. Lista z podobnymi danymi znajduje się poniżej.<br>Kliknij przycisk Zapisz, aby kontynuować tworzenie, lub przycisk Anuluj lub przycisk Anuluj aby przerwać tworzenie.',
|
||||
'MSG_SHOW_DUPLICATES' => 'Kontrahent o podobnych dany już istnieje w systemie. Lista z podobnymi danymi znajduje się poniżej.<br>Kliknij przycisk Zapisz, aby kontynuować tworzenie nowego Kontrahenta, lub przycisk Anuluj aby przerwać tworzenie.',
|
||||
'NTC_COPY_BILLING_ADDRESS' => 'Kopiuj adres Korespondencyjny do adresu Wysyłki',
|
||||
'NTC_COPY_BILLING_ADDRESS2' => 'Kopiuj do adresu wysyłki',
|
||||
'NTC_COPY_REGISTER_ADDRESS' => 'Kopiuj adres wysyłki do adresu Korespondencyjnego',
|
||||
'NTC_COPY_REGISTER_ADDRESS2' => 'Kopiuj do adresu Korespondencyjnego',
|
||||
'NTC_DELETE_CONFIRMATION' => 'Czy na pewno chcesz usunąć ten rekord?',
|
||||
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Czy na pewno chcesz usunąć ten rekord?',
|
||||
'NTC_REMOVE_MEMBER_ORG_CONFIRMATION' => 'Czy na pewno chcesz usunąć informacje o członkostwie?',
|
||||
'LBL_ASSIGNED_USER_NAME' => 'Przypisane do:',
|
||||
'LBL_PROSPECT_LIST' => 'Grupy docelowe',
|
||||
'LBL_ACCOUNTS_SUBPANEL_TITLE' => 'Kontrahenci',
|
||||
'LBL_PROJECT_SUBPANEL_TITLE' => 'Projekty',
|
||||
'LBL_COPY' => 'Kopiuj' /* for 508 compliance fix */,
|
||||
//For export labels
|
||||
'LBL_ACCOUNT_TYPE' => 'Rodzaj Kontrahenta',
|
||||
'LBL_CAMPAIGN_ID' => 'ID Kampanii reklamowej',
|
||||
'LBL_PARENT_ID' => 'Identyfikator rodzica',
|
||||
'LBL_PHONE_ALTERNATE' => 'Alternatywny telefon',
|
||||
'LBL_EXPORT_ASSIGNED_USER_NAME' => 'Przydzielony do Użytkownika',
|
||||
// SNIP
|
||||
'LBL_CONTACT_HISTORY_SUBPANEL_TITLE' => 'Powiązane Kontakty \ Wiadomości e-mail',
|
||||
);
|
||||
?>
|
||||
76
modules/Accounts/metadata/SearchFields.php
Normal file
76
modules/Accounts/metadata/SearchFields.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
$searchFields['Accounts'] =
|
||||
array (
|
||||
'name' => array( 'query_type'=>'default'),
|
||||
'account_type'=> array('query_type'=>'default', 'options' => 'account_type_dom', 'template_var' => 'ACCOUNT_TYPE_OPTIONS'),
|
||||
'industry'=> array('query_type'=>'default', 'options' => 'industry_dom', 'template_var' => 'INDUSTRY_OPTIONS'),
|
||||
'annual_revenue'=> array('query_type'=>'default'),
|
||||
'address_street'=> array('query_type'=>'default','db_field'=>array('billing_address_street','register_address_street')),
|
||||
'address_city'=> array('query_type'=>'default','db_field'=>array('billing_address_city','register_address_city'), 'vname' =>'LBL_CITY'),
|
||||
'address_state'=> array('query_type'=>'default','db_field'=>array('billing_address_state','register_address_state'), 'vname' =>'LBL_STATE'),
|
||||
'address_postalcode'=> array('query_type'=>'default','db_field'=>array('billing_address_postalcode','register_address_postalcode'), 'vname' =>'LBL_POSTAL_CODE'),
|
||||
'address_country'=> array('query_type'=>'default','db_field'=>array('billing_address_country','register_address_country'), 'vname' =>'LBL_COUNTRY'),
|
||||
'rating'=> array('query_type'=>'default'),
|
||||
'phone'=> array('query_type'=>'default','db_field'=>array('phone_office'),'vname' =>'LBL_ANY_PHONE'),
|
||||
'email'=> array(
|
||||
'query_type' => 'default',
|
||||
'operator' => 'subquery',
|
||||
'subquery' => 'SELECT eabr.bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (ea.id = eabr.email_address_id) WHERE eabr.deleted=0 AND ea.email_address LIKE',
|
||||
'db_field' => array(
|
||||
'id',
|
||||
),
|
||||
'vname' =>'LBL_ANY_EMAIL',
|
||||
),
|
||||
'website'=> array('query_type'=>'default'),
|
||||
'employees'=> array('query_type'=>'default'),
|
||||
'sic_code'=> array('query_type'=>'default'),
|
||||
'ticker_symbol'=> array('query_type'=>'default'),
|
||||
'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'),
|
||||
'assigned_user_id'=> array('query_type'=>'default'),
|
||||
//Range Search Support
|
||||
'range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
|
||||
'start_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
|
||||
'end_range_date_entered' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
|
||||
'range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
|
||||
'start_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
|
||||
'end_range_date_modified' => array ('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
|
||||
//Range Search Support
|
||||
'without_history'=> array('query_type'=>'default','db_field'=>array('without_history'),'my_items'=>true, 'vname' => 'LBL_WITHOUT_HISTORY', 'type' => 'bool'),
|
||||
);
|
||||
?>
|
||||
61
modules/Accounts/metadata/acldefs.php
Normal file
61
modules/Accounts/metadata/acldefs.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
// created: 2005-10-19 11:16:08
|
||||
$acldefs['Accounts'] = array (
|
||||
'forms' =>
|
||||
array (
|
||||
'by_name' =>
|
||||
array (
|
||||
'btn1' =>
|
||||
array (
|
||||
'display_option' => 'disabled',
|
||||
'action_option' => 'list',
|
||||
'app_action' => 'EditView',
|
||||
'module' => 'Accounts',
|
||||
),
|
||||
),
|
||||
),
|
||||
'form_names' =>
|
||||
array (
|
||||
'by_id' => 'by_id',
|
||||
'by_name' => 'by_name',
|
||||
'DetailView' => 'DetailView',
|
||||
'EditView' => 'EditView',
|
||||
),
|
||||
);
|
||||
?>
|
||||
84
modules/Accounts/metadata/additionalDetails.php
Normal file
84
modules/Accounts/metadata/additionalDetails.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
function additionalDetailsAccount($fields) {
|
||||
static $mod_strings;
|
||||
global $app_strings;
|
||||
if(empty($mod_strings)) {
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, 'Accounts');
|
||||
}
|
||||
$overlib_string = '';
|
||||
|
||||
if(!empty($fields['BILLING_ADDRESS_STREET']) || !empty($fields['BILLING_ADDRESS_CITY']) ||
|
||||
!empty($fields['BILLING_ADDRESS_STATE']) || !empty($fields['BILLING_ADDRESS_POSTALCODE']) ||
|
||||
!empty($fields['BILLING_ADDRESS_COUNTRY']))
|
||||
$overlib_string .= '<b>' . $mod_strings['LBL_BILLING_ADDRESS'] . '</b><br>';
|
||||
if(!empty($fields['BILLING_ADDRESS_STREET'])) $overlib_string .= $fields['BILLING_ADDRESS_STREET'] . '<br>';
|
||||
if(!empty($fields['BILLING_ADDRESS_STREET_2'])) $overlib_string .= $fields['BILLING_ADDRESS_STREET_2'] . '<br>';
|
||||
if(!empty($fields['BILLING_ADDRESS_STREET_3'])) $overlib_string .= $fields['BILLING_ADDRESS_STREET_3'] . '<br>';
|
||||
if(!empty($fields['BILLING_ADDRESS_STREET_4'])) $overlib_string .= $fields['BILLING_ADDRESS_STREET_4'] . '<br>';
|
||||
if(!empty($fields['BILLING_ADDRESS_CITY'])) $overlib_string .= $fields['BILLING_ADDRESS_CITY'] . ', ';
|
||||
if(!empty($fields['BILLING_ADDRESS_STATE'])) $overlib_string .= $fields['BILLING_ADDRESS_STATE'] . ' ';
|
||||
if(!empty($fields['BILLING_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['BILLING_ADDRESS_POSTALCODE'] . ' ';
|
||||
if(!empty($fields['BILLING_ADDRESS_COUNTRY'])) $overlib_string .= $fields['BILLING_ADDRESS_COUNTRY'] . '<br>';
|
||||
|
||||
if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4))
|
||||
$overlib_string .= '<br>';
|
||||
|
||||
if(!empty($fields['PHONE_FAX'])) $overlib_string .= '<b>'. $mod_strings['LBL_FAX'] . '</b> <span class="phone">' . $fields['PHONE_FAX'] . '</span><br>';
|
||||
if(!empty($fields['PHONE_ALTERNATE'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_ALTERNATE'] . '</span><br>';
|
||||
if(!empty($fields['WEBSITE']))
|
||||
$overlib_string .= '<a target=_blank href=http://'. $fields['WEBSITE'] . '>' . $fields['WEBSITE'] . '</a><br>';
|
||||
if(!empty($fields['INDUSTRY'])) $overlib_string .= '<b>'. $mod_strings['LBL_INDUSTRY'] . '</b> ' . $fields['INDUSTRY'] . '<br>';
|
||||
if(!empty($fields['DESCRIPTION'])) {
|
||||
$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
|
||||
if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
|
||||
}
|
||||
|
||||
return array('fieldToAddTo' => 'NAME',
|
||||
'string' => $overlib_string,
|
||||
'editLink' => "index.php?action=EditView&module=Accounts&return_module=Accounts&record={$fields['ID']}",
|
||||
'viewLink' => "index.php?action=DetailView&module=Accounts&return_module=Accounts&record={$fields['ID']}");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
336
modules/Accounts/metadata/detailviewdefs.php
Normal file
336
modules/Accounts/metadata/detailviewdefs.php
Normal file
@@ -0,0 +1,336 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
$viewdefs['Accounts']['DetailView'] = array(
|
||||
'templateMeta' => array(
|
||||
'form' => array(
|
||||
'buttons' => array(
|
||||
0 => 'EDIT',
|
||||
1 => 'DELETE'
|
||||
|
||||
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
)
|
||||
),
|
||||
'includes' => array(
|
||||
array(
|
||||
'file' => 'modules/Accounts/Account.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/AccountDetailView.js'
|
||||
)
|
||||
)
|
||||
),
|
||||
'panels' => array(
|
||||
'lbl_account_information' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'name',
|
||||
'comment' => 'Name of the Company',
|
||||
'label' => 'LBL_NAME',
|
||||
'displayParams' => array(
|
||||
'enableConnectors' => true,
|
||||
'module' => 'Accounts',
|
||||
'connectors' => array(
|
||||
0 => 'ext_rest_linkedin'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'name' => 'index_dbf',
|
||||
'label' => 'LBL_INDEX'
|
||||
)
|
||||
),
|
||||
|
||||
array(
|
||||
'to_vatid',
|
||||
'regon'
|
||||
),
|
||||
array(
|
||||
'krs',
|
||||
'natural_person'
|
||||
),
|
||||
array(
|
||||
'ks_account',
|
||||
'vat_payer',
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'shop_number',
|
||||
'label' => 'Numer sklepu'
|
||||
),
|
||||
'supplier_code',
|
||||
|
||||
),
|
||||
array(
|
||||
'iln',
|
||||
'parent_name',
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'register_address_street',
|
||||
'label' => 'LBL_REGISTER_ADDRESS',
|
||||
'type' => 'address',
|
||||
'displayParams' => array(
|
||||
'key' => 'register'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'name' => 'billing_address_street',
|
||||
'label' => 'LBL_BILLING_ADDRESS',
|
||||
'type' => 'address',
|
||||
'displayParams' => array(
|
||||
'key' => 'billing'
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
),
|
||||
array(
|
||||
'maps',
|
||||
'isHidden'
|
||||
),
|
||||
|
||||
array(
|
||||
array(
|
||||
'name' => 'email1',
|
||||
'studio' => 'false',
|
||||
'label' => 'LBL_EMAIL'
|
||||
),
|
||||
array(
|
||||
'name' => 'items_list_panel',
|
||||
'hideLabel' => false,
|
||||
'label' => 'LBL_WEBSITE_NAME',
|
||||
'customCode' => "
|
||||
{include file='modules/Accounts/tpls/Websites_DetailView.tpl'}"
|
||||
/*
|
||||
<input type="hidden" name="websites_list" id="websites_list" value=\'{$WEBSITES_LIST}\'>
|
||||
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV2">
|
||||
|
||||
</div><br>', */
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
|
||||
),
|
||||
array(
|
||||
'name' => 'items_list_panel',
|
||||
'hideLabel' => false,
|
||||
'label' => 'Telefony',
|
||||
'customCode' => "
|
||||
{include file='modules/Accounts/tpls/Telephones_DetailView.tpl'}"
|
||||
/*
|
||||
<input type="hidden" name="websites_list" id="websites_list" value=\'{$WEBSITES_LIST}\'>
|
||||
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV2">
|
||||
|
||||
</div><br>', */
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'description',
|
||||
'comment' => 'Full text of the note',
|
||||
'label' => 'LBL_DESCRIPTION'
|
||||
),
|
||||
array(
|
||||
'name' => 'pdf_text',
|
||||
'comment' => 'Full text of the note',
|
||||
'label' => 'Uwagi na fakturze'
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'phone_office',
|
||||
'comment' => 'The office phone number',
|
||||
'label' => 'LBL_PHONE_OFFICE'
|
||||
),
|
||||
array(
|
||||
'name' => 'phone_fax',
|
||||
'comment' => 'The fax phone number of this company',
|
||||
'label' => 'LBL_FAX'
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'account_type',
|
||||
'comment' => 'The Company is of this type',
|
||||
'label' => 'LBL_TYPE'
|
||||
),
|
||||
array(
|
||||
'name' => 'account_type2',
|
||||
'comment' => 'The Company is of this type',
|
||||
'label' => 'LBL_TYPE_2'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'invoice_type',
|
||||
'ecmdeliverycondition_name'
|
||||
),
|
||||
array(
|
||||
'',
|
||||
array(
|
||||
'name' => 'currency_id',
|
||||
'label' => 'LBL_CURRENCY'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'payment_method',
|
||||
'invoice_bank_account'
|
||||
),
|
||||
array(
|
||||
'payment_date_days',
|
||||
''
|
||||
)
|
||||
|
||||
),
|
||||
|
||||
'LBL_SHOP_PANEL' => array(
|
||||
array(
|
||||
'shop_user',
|
||||
'isAllegroUser'
|
||||
)
|
||||
),
|
||||
|
||||
'Rozrachunki' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'saldo',
|
||||
'label' => 'Saldo',
|
||||
'customCode' => '{$saldo}'
|
||||
),
|
||||
/*
|
||||
array(
|
||||
'name' => 'today_saldo',
|
||||
'label' => 'Saldo na dziś',
|
||||
'customCode' => '{$today_saldo}'
|
||||
) */
|
||||
),
|
||||
array('allow_prevent','allow_debt_collection'
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'rozrachunki',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '<a href="index.php?module=EcmPaymentStates&action=AccountPaymentStates&account_id={$fields.id.value}">Sprawdź</a>'
|
||||
)
|
||||
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_DELIVERY_ADDRESSES' => array(
|
||||
0 => array(
|
||||
0 => array(
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '{$POSITIONS}'
|
||||
)
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_BANK_ACCOUNTS' => array(
|
||||
0 => array(
|
||||
0 => array(
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '{$POSITIONS4}'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'LBL_PANEL_DISCOUNTS' => array(
|
||||
0 => array(
|
||||
0 => array(
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '{$POSITIONS2}'
|
||||
)
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_CATEGORIES' => array(
|
||||
0 => array(
|
||||
0 => array(
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '{$POSITIONS3}'
|
||||
)
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_SALES' => array(
|
||||
0 => array(
|
||||
0 => array(
|
||||
'name' => 'sales_chart_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '{include file="modules/Accounts/tpls/SalesChart.tpl"}'
|
||||
)
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_ASSIGNMENT' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'assigned_user_name',
|
||||
'label' => 'LBL_ASSIGNED_TO'
|
||||
),
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}'
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'date_entered',
|
||||
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
406
modules/Accounts/metadata/editviewdefs.php
Normal file
406
modules/Accounts/metadata/editviewdefs.php
Normal file
@@ -0,0 +1,406 @@
|
||||
<?php
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
$viewdefs['Accounts']['EditView'] = array(
|
||||
'templateMeta' => array(
|
||||
'form' => array(
|
||||
'buttons' => array(
|
||||
array(
|
||||
'customCode' => '<input type="submit" name="save" class="button" value="{$LBL_SAVE}" onclick="saveItems(true);saveItems2(true);saveItems3(true);saveItems4(true);this.form.action.value=\'Save\';return check_form_(\'EditView\');" />'
|
||||
),
|
||||
'CANCEL',
|
||||
array(
|
||||
'customCode' => '<link rel="stylesheet" href="modules/Accounts/css/jquery-ui.css">'
|
||||
)
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array(
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
)
|
||||
),
|
||||
'includes' => array(
|
||||
array(
|
||||
'file' => 'modules/Accounts/jquery.min.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/jquery_ui.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/Account.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/Banks.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'include/JSON.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/Addresses.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/Discounts.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/Categories.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/js/Websites.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/js/Telephones.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/js/States.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/MyTable.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/Accounts/paramsMT.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'include/ECM/GusApiSugar/GusApiSugar.js'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'panels' => array(
|
||||
|
||||
'lbl_account_information' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'name',
|
||||
'label' => 'LBL_NAME',
|
||||
'displayParams' => array(
|
||||
'required' => true,
|
||||
'rows' => 4,
|
||||
'cols' => 50
|
||||
)
|
||||
),
|
||||
array(
|
||||
'name' => 'index_dbf',
|
||||
'label' => 'LBL_INDEX'
|
||||
)
|
||||
|
||||
),
|
||||
|
||||
array(
|
||||
array(
|
||||
'name' => 'to_vatid',
|
||||
'label' => 'LBL_TO_VATID',
|
||||
'customCode' => '<input value="{$fields.to_vatid.value}" name="to_vatid" id="to_vatid" type="text"/><input type="button" onClick="GusApiInit();" value="Szukaj w GUS"><div id="GusApiSearch" style="display:none"><div><p id="nip_exist" style="display:none">{$MOD.LBL_NIP_EXIST}</p>'
|
||||
),
|
||||
'regon'
|
||||
|
||||
),
|
||||
array(
|
||||
'vat_payer',
|
||||
'iln'
|
||||
),
|
||||
array(
|
||||
'krs',
|
||||
'natural_person'
|
||||
),
|
||||
array(
|
||||
|
||||
array(
|
||||
'name' => 'shop_number',
|
||||
'label' => 'Numer sklepu'
|
||||
),
|
||||
'supplier_code',
|
||||
),
|
||||
array(
|
||||
'parent_name',
|
||||
'isHidden'
|
||||
),
|
||||
array(
|
||||
|
||||
array(
|
||||
'name' => 'register_address_street',
|
||||
'hideLabel' => true,
|
||||
'type' => 'address',
|
||||
'displayParams' => array(
|
||||
'key' => 'register',
|
||||
'rows' => 2,
|
||||
'cols' => 50,
|
||||
'maxlength' => 150
|
||||
)
|
||||
),
|
||||
array(
|
||||
'name' => 'billing_address_street',
|
||||
'hideLabel' => true,
|
||||
'type' => 'address',
|
||||
'displayParams' => array(
|
||||
'key' => 'billing',
|
||||
'rows' => 2,
|
||||
'cols' => 50,
|
||||
'maxlength' => 150
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
array(
|
||||
|
||||
array(
|
||||
'name' => 'email1',
|
||||
'studio' => 'false',
|
||||
'label' => 'LBL_EMAIL'
|
||||
),
|
||||
array(
|
||||
'name' => 'items_list_panel',
|
||||
'hideLabel' => false,
|
||||
'label' => 'LBL_WEBSITE_NAME',
|
||||
'customCode' => "
|
||||
{include file='modules/Accounts/tpls/Websites_EditView.tpl'}"
|
||||
/*
|
||||
<input type="hidden" name="websites_list" id="websites_list" value=\'{$WEBSITES_LIST}\'>
|
||||
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV2">
|
||||
|
||||
</div><br>', */
|
||||
)
|
||||
),
|
||||
array(
|
||||
|
||||
array(),
|
||||
array(
|
||||
'name' => 'items_list_panel',
|
||||
'hideLabel' => false,
|
||||
'label' => 'Telefony',
|
||||
'customCode' => "
|
||||
{include file='modules/Accounts/tpls/Telephones_EditView.tpl'}"
|
||||
/*
|
||||
<input type="hidden" name="websites_list" id="websites_list" value=\'{$WEBSITES_LIST}\'>
|
||||
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV2">
|
||||
|
||||
</div><br>', */
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'phone_office',
|
||||
'label' => 'LBL_PHONE_OFFICE'
|
||||
),
|
||||
|
||||
array(
|
||||
'name' => 'phone_fax',
|
||||
'label' => 'LBL_FAX'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'account_type',
|
||||
'account_type2'
|
||||
),
|
||||
array(
|
||||
'invoice_type',
|
||||
'ecmdeliverycondition_name'
|
||||
),
|
||||
array(),
|
||||
array(
|
||||
array(
|
||||
'name' => 'description',
|
||||
'label' => 'LBL_DESCRIPTION',
|
||||
'displayParams' => array(
|
||||
'rows' => 4,
|
||||
'cols' => 50
|
||||
)
|
||||
|
||||
),
|
||||
array(
|
||||
'name' => 'pdf_text',
|
||||
'label' => 'Uwagi na fakturze',
|
||||
'displayParams' => array(
|
||||
'rows' => 4,
|
||||
'cols' => 50
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
),
|
||||
array(
|
||||
'payment_method',
|
||||
array(
|
||||
'name' => 'bankaccount',
|
||||
'label' => 'LBL_INVOICE_BANK_ACCOUNT',
|
||||
'customCode' => '{$BANKACCOUNTS}'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'payment_date_days',
|
||||
'ks_account',
|
||||
),
|
||||
array(
|
||||
'',
|
||||
array(
|
||||
'name' => 'currency_id',
|
||||
'label' => 'LBL_CURRENCY'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'allow_prevent', 'allow_debt_collection'
|
||||
),
|
||||
|
||||
),
|
||||
'LBL_SHOP_PANEL' => array(
|
||||
array(
|
||||
'shop_user',
|
||||
'isAllegroUser'
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_DELIVERY_ADDRESSES' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '
|
||||
<input type="hidden" name="position_list" id="position_list" value=\'{$POSITION_LIST}\'>
|
||||
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
|
||||
<div style="width:1100px;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV">
|
||||
<table class="positions" style="width:1100px;" id="itemsTable">
|
||||
<thead id="head">
|
||||
<tr id="tr">
|
||||
<td width="3%">{$MOD.LBL_ADDRESS_POSITION}</td>
|
||||
<td width="12%">{$MOD.LBL_ADDRESS_NAME}</td>
|
||||
<td width="12%">{$MOD.LBL_ADDRESS_STREET}</td>
|
||||
<td width="10%">{$MOD.LBL_ADDRESS_CITY}</td>
|
||||
<td width="10%">{$MOD.LBL_ADDRESS_POSTALCODE}</td>
|
||||
<td width="10%">{$MOD.LBL_ADDRESS_COUNTRY}</td>
|
||||
<td width="10%">{$MOD.LBL_ADDRESS_NIP}</td>
|
||||
<td width="10%">{$MOD.LBL_ADDRESS_ILN}</td>
|
||||
<td width="2%"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div><br>'
|
||||
)
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_BANK_ACCOUNTS' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '
|
||||
<input type="hidden" name="position_list4" id="position_list4" value=\'{$POSITION_LIST4}\'>
|
||||
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
|
||||
<div style="width:1100px;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV">
|
||||
<table class="positions" style="width:1100px;" id="itemsTable4">
|
||||
<thead id="head">
|
||||
<tr id="tr">
|
||||
<td width="3%">{$MOD.LBL_BANK_POSITION}</td>
|
||||
<td width="12%">{$MOD.LBL_BANK_NAME}</td>
|
||||
<td width="12%">{$MOD.LBL_BANK_ACCOUNT}</td>
|
||||
<td width="2%"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div><br>'
|
||||
)
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_DISCOUNTS' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '
|
||||
<input type="hidden" name="position_list2" id="position_list2" value=\'{$POSITION_LIST2}\'>
|
||||
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
|
||||
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV2">
|
||||
<table class="positions" style="width:100%;" id="itemsTable2">
|
||||
<thead id="head">
|
||||
<tr id="tr">
|
||||
<td width="70%">{$MOD.LBL_PRODUCT_GROUP}</td>
|
||||
<td width="20%">{$MOD.LBL_DISCOUNT}</td>
|
||||
<td width="10%">{$MOD.LBL_EDITTABLE_OPTIONS}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div><br>'
|
||||
)
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_CATEGORIES' => array(
|
||||
array(
|
||||
array(
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
'hideLabel' => true,
|
||||
'customCode' => '
|
||||
<input type="hidden" name="position_list3" id="position_list3" value=\'{$POSITION_LIST3}\'>
|
||||
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
|
||||
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;height:{$OPT.position_table_height}px;max-height:{$OPT.position_table_height}px;overflow:auto;" id="itemsTableDIV3">
|
||||
<table class="positions" style="width:100%;" id="itemsTable3">
|
||||
<thead id="head">
|
||||
<tr id="tr">
|
||||
<td width="90%">{$MOD.LBL_CATEGORY_NAME}</td>
|
||||
<td width="10%">{$MOD.LBL_EDITTABLE_OPTIONS}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div><br>'
|
||||
)
|
||||
)
|
||||
),
|
||||
'LBL_PANEL_ASSIGNMENT' => array(
|
||||
|
||||
array(
|
||||
array(
|
||||
'name' => 'assigned_user_name',
|
||||
'label' => 'LBL_ASSIGNED_TO'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
38
modules/Accounts/metadata/fieldGroups.php
Normal file
38
modules/Accounts/metadata/fieldGroups.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
?>
|
||||
217
modules/Accounts/metadata/listviewdefs.php
Normal file
217
modules/Accounts/metadata/listviewdefs.php
Normal file
@@ -0,0 +1,217 @@
|
||||
<?php
|
||||
if (!defined('sugarEntry') || !sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
$listViewDefs['Accounts'] = array(
|
||||
'INDEX_DBF' => array(
|
||||
'width' => '3%',
|
||||
'label' => 'LBL_INDEX',
|
||||
'link' => true,
|
||||
'default' => true
|
||||
),
|
||||
'NAME' => array(
|
||||
'width' => '20%',
|
||||
'label' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'link' => true,
|
||||
'default' => true
|
||||
),
|
||||
'REGISTER_ADDRESS_CITY' => array(
|
||||
'width' => '5%',
|
||||
'label' => 'LBL_LIST_CITY',
|
||||
'default' => true
|
||||
),
|
||||
'REGISTER_ADDRESS_POSTALCODE' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_REGISTER_ADDRESS_POSTALCODE',
|
||||
'default' => true
|
||||
),
|
||||
'REGISTER_ADDRESS_STREET' => array(
|
||||
'width' => '15%',
|
||||
'label' => 'LBL_REGISTER_ADDRESS_STREET',
|
||||
'default' => true
|
||||
),
|
||||
'TO_VATID' => array(
|
||||
'width' => '5%',
|
||||
'label' => 'LBL_TO_VATID',
|
||||
'default' => true
|
||||
),
|
||||
'INVOICE_TYPE' => array(
|
||||
'width' => '5%',
|
||||
'label' => 'LBL_INVOICE_TYPE',
|
||||
'default' => true
|
||||
),
|
||||
'CURRENCY_ID' => array(
|
||||
'width' => '2%',
|
||||
'label' => 'LBL_CURRENCY',
|
||||
'default' => true
|
||||
),
|
||||
|
||||
'ASSIGNED_USER_NAME' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_LIST_ASSIGNED_USER',
|
||||
'module' => 'Employees',
|
||||
'id' => 'ASSIGNED_USER_ID',
|
||||
'default' => false
|
||||
),
|
||||
'ACCOUNT_TYPE' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_ACCOUNT_TYPE',
|
||||
'default' => true
|
||||
),
|
||||
'INDUSTRY' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_INDUSTRY',
|
||||
'default' => false
|
||||
),
|
||||
'ANNUAL_REVENUE' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_ANNUAL_REVENUE',
|
||||
'default' => false
|
||||
),
|
||||
'PHONE_FAX' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_PHONE_FAX',
|
||||
'default' => false
|
||||
),
|
||||
'BILLING_ADDRESS_STREET' => array(
|
||||
'width' => '15%',
|
||||
'label' => 'LBL_BILLING_ADDRESS_STREET',
|
||||
'default' => false
|
||||
),
|
||||
'BILLING_ADDRESS_STATE' => array(
|
||||
'width' => '7%',
|
||||
'label' => 'LBL_BILLING_ADDRESS_STATE',
|
||||
'default' => false
|
||||
),
|
||||
'BILLING_ADDRESS_POSTALCODE' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_BILLING_ADDRESS_POSTALCODE',
|
||||
'default' => false
|
||||
),
|
||||
'REGISTER_ADDRESS_STATE' => array(
|
||||
'width' => '7%',
|
||||
'label' => 'LBL_REGISTER_ADDRESS_STATE',
|
||||
'default' => false
|
||||
),
|
||||
|
||||
'REGISTER_ADDRESS_COUNTRY' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_REGISTER_ADDRESS_COUNTRY',
|
||||
'default' => false
|
||||
),
|
||||
'RATING' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_RATING',
|
||||
'default' => false
|
||||
),
|
||||
'PHONE_ALTERNATE' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_OTHER_PHONE',
|
||||
'default' => false
|
||||
),
|
||||
'WEBSITE' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_WEBSITE',
|
||||
'default' => false
|
||||
),
|
||||
'OWNERSHIP' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_OWNERSHIP',
|
||||
'default' => false
|
||||
),
|
||||
'EMPLOYEES' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_EMPLOYEES',
|
||||
'default' => false
|
||||
),
|
||||
'SIC_CODE' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_SIC_CODE',
|
||||
'default' => false
|
||||
),
|
||||
'TICKER_SYMBOL' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_TICKER_SYMBOL',
|
||||
'default' => false
|
||||
),
|
||||
'DATE_MODIFIED' => array(
|
||||
'width' => '5%',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
'default' => false
|
||||
),
|
||||
'CREATED_BY_NAME' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_CREATED',
|
||||
'default' => false
|
||||
),
|
||||
'MODIFIED_BY_NAME' => array(
|
||||
'width' => '10%',
|
||||
'label' => 'LBL_MODIFIED',
|
||||
'default' => false
|
||||
),
|
||||
'DATE_ENTERED' => array(
|
||||
'width' => '5%',
|
||||
'label' => 'LBL_DATE_ENTERED',
|
||||
'default' => false
|
||||
),
|
||||
'REGON' => array(
|
||||
'width' => '5%',
|
||||
'label' => 'LBL_REGON',
|
||||
'default' => false
|
||||
),
|
||||
'KS_ACCOUNT' => array(
|
||||
'width' => '5%',
|
||||
'label' => 'Konto KS',
|
||||
'default' => false
|
||||
),
|
||||
|
||||
'SHOP_NUMBER' => array (
|
||||
'width' => '5%',
|
||||
'label' => 'Numer sklepu',
|
||||
'default' => true
|
||||
),
|
||||
|
||||
'SUPPLIER_CODE' => array (
|
||||
'width' => '5%',
|
||||
'label' => 'Kod dostawcy',
|
||||
'default' => true
|
||||
),
|
||||
);
|
||||
?>
|
||||
52
modules/Accounts/metadata/metafiles.php
Normal file
52
modules/Accounts/metadata/metafiles.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
/*
|
||||
* Created on Jun 1, 2007
|
||||
*
|
||||
* To change the template for this generated file go to
|
||||
* Window - Preferences - PHPeclipse - PHP - Code Templates
|
||||
*/
|
||||
$metafiles['Accounts'] = array(
|
||||
'detailviewdefs' => 'modules/Accounts/metadata/detailviewdefs.php',
|
||||
'editviewdefs' => 'modules/Accounts/metadata/editviewdefs.php',
|
||||
'listviewdefs' => 'modules/Accounts/metadata/listviewdefs.php',
|
||||
'searchdefs' => 'modules/Accounts/metadata/searchdefs.php',
|
||||
'popupdefs' => 'modules/Accounts/metadata/popupdefs.php',
|
||||
'searchfields' => 'modules/Accounts/metadata/SearchFields.php',
|
||||
|
||||
);
|
||||
?>
|
||||
109
modules/Accounts/metadata/popupdefs.php
Normal file
109
modules/Accounts/metadata/popupdefs.php
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
$popupMeta = array(
|
||||
'moduleMain' => 'Account',
|
||||
'varName' => 'ACCOUNT',
|
||||
'orderBy' => 'name',
|
||||
'whereClauses' => array(
|
||||
'name' => 'accounts.name',
|
||||
'register_address_city' => 'accounts.register_address_city',
|
||||
'phone_office' => 'accounts.phone_office'
|
||||
),
|
||||
'searchInputs' => array('name', 'register_address_city', 'phone_office'),
|
||||
|
||||
'listviewdefs' => array(
|
||||
'NAME' => array(
|
||||
'width' => '40',
|
||||
'label' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'link' => true,
|
||||
'default' => true,
|
||||
),
|
||||
'REGISTER_ADDRESS_CITY' => array(
|
||||
'width' => '10',
|
||||
'label' => 'LBL_LIST_CITY',
|
||||
'default' => true,
|
||||
),
|
||||
'REGISTER_ADDRESS_STATE' => array(
|
||||
'width' => '15',
|
||||
'label' => 'LBL_STATE',
|
||||
'default' => true,
|
||||
),
|
||||
'REGISTER_ADDRESS_COUNTRY' => array(
|
||||
'width' => '10',
|
||||
'label' => 'LBL_COUNTRY',
|
||||
'default' => true,
|
||||
),
|
||||
'REGISTER_ADDRESS_POSTALCODE' => array(
|
||||
'width' => '8',
|
||||
'label' => 'Kod',
|
||||
'default' => true,
|
||||
),
|
||||
'ACCOUNT_TYPE' => array(
|
||||
'width' => '2',
|
||||
'label' => 'LBL_ACCOUNT_TYPE',
|
||||
'default' => true,
|
||||
),
|
||||
|
||||
),
|
||||
'searchdefs' => array(
|
||||
'name'=> array (
|
||||
'name' => 'name',
|
||||
'label' => 'LBL_NAME',
|
||||
'displayParams' =>
|
||||
array (
|
||||
'required' => true,
|
||||
'rows' => 1,
|
||||
'cols' => 50,
|
||||
),
|
||||
),
|
||||
'index_dbf',
|
||||
'to_vatid',
|
||||
'email',
|
||||
/*
|
||||
array(
|
||||
'name' => 'assigned_user_id',
|
||||
'label'=>'LBL_ASSIGNED_TO',
|
||||
'type' => 'enum',
|
||||
'function' => array('name' => 'get_user_array', 'params' => array(false))
|
||||
), */
|
||||
)
|
||||
);
|
||||
?>
|
||||
126
modules/Accounts/metadata/quickcreatedefs.php
Normal file
126
modules/Accounts/metadata/quickcreatedefs.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________..
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
$viewdefs ['Accounts'] =
|
||||
array (
|
||||
'QuickCreate' =>
|
||||
array (
|
||||
'templateMeta' =>
|
||||
array (
|
||||
'form' =>
|
||||
array (
|
||||
'buttons' =>
|
||||
array (
|
||||
'SAVE',
|
||||
'CANCEL',
|
||||
),
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' =>
|
||||
array (
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30',
|
||||
),
|
||||
),
|
||||
'includes' =>
|
||||
array (
|
||||
array (
|
||||
'file' => 'modules/Accounts/Account.js',
|
||||
),
|
||||
),
|
||||
),
|
||||
'panels' =>
|
||||
array (
|
||||
'default' =>
|
||||
array (
|
||||
array (
|
||||
array (
|
||||
'name' => 'name',
|
||||
'displayParams' =>
|
||||
array (
|
||||
'required' => true,
|
||||
),
|
||||
),
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'website',
|
||||
),
|
||||
array (
|
||||
'name' => 'phone_office',
|
||||
),
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'email1',
|
||||
),
|
||||
array (
|
||||
'name' => 'phone_fax',
|
||||
),
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'industry',
|
||||
),
|
||||
array (
|
||||
'name' => 'account_type',
|
||||
),
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'assigned_user_name',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
146
modules/Accounts/metadata/searchdefs.php
Normal file
146
modules/Accounts/metadata/searchdefs.php
Normal file
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
/* * *******************************************************************************
|
||||
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
|
||||
*
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
|
||||
*
|
||||
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
|
||||
* details.
|
||||
|
||||
*
|
||||
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
|
||||
* 02110-1301 USA.
|
||||
|
||||
*
|
||||
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
|
||||
*
|
||||
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
|
||||
*
|
||||
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
|
||||
* "Powered by SugarCRM".
|
||||
|
||||
* ****************************************************************************** */
|
||||
|
||||
$searchdefs['Accounts'] = array(
|
||||
'templateMeta' => array(
|
||||
'maxColumns' => '3',
|
||||
'widths' => array(
|
||||
'label' => '5',
|
||||
'field' => '25'
|
||||
),
|
||||
),
|
||||
'layout' => array(
|
||||
'basic_search' => array(
|
||||
'name' =>
|
||||
array(
|
||||
'name' => 'name',
|
||||
'type' => 'name',
|
||||
),
|
||||
'account_type',
|
||||
'index_dbf',
|
||||
'to_vatid',
|
||||
'current_user_only' =>
|
||||
array(
|
||||
'name' => 'current_user_only',
|
||||
'label' => 'LBL_CURRENT_USER_FILTER',
|
||||
'type' => 'bool',
|
||||
),
|
||||
'isHidden' =>
|
||||
array(
|
||||
'name' => 'isHidden',
|
||||
'label' => 'Pokaż ukryte',
|
||||
'type' => 'bool',
|
||||
|
||||
),
|
||||
|
||||
),
|
||||
'advanced_search' => array(
|
||||
'name' =>
|
||||
array(
|
||||
'name' => 'name',
|
||||
'type' => 'name',
|
||||
),
|
||||
'index_dbf',
|
||||
'to_vatid',
|
||||
'account_type',
|
||||
'register_address_city' =>
|
||||
array(
|
||||
'name' => 'register_address_city',
|
||||
'label' => 'LBL_LIST_CITY',
|
||||
),
|
||||
'register_address_postalcode' =>
|
||||
array(
|
||||
'name' => 'register_address_postalcode',
|
||||
'label' => 'LBL_LIST_POSTALCODE',
|
||||
),
|
||||
'register_address_ecmcommune_name' =>
|
||||
array(
|
||||
'name' => 'register_address_ecmcommune_name',
|
||||
'label' => 'LBL_ECMCOMMUNE',
|
||||
),
|
||||
|
||||
'isHidden' =>
|
||||
array(
|
||||
'name' => 'isHidden',
|
||||
'label' => 'Pokaż ukryte',
|
||||
'type' => 'bool',
|
||||
),
|
||||
'assigned_user_name',
|
||||
'without_history' => array(
|
||||
'name' => 'without_history',
|
||||
'label' => 'LBL_WITHOUT_HISTORY',
|
||||
'type' => 'bool',
|
||||
),
|
||||
'iln'
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
||||
66
modules/Accounts/metadata/studio.php
Normal file
66
modules/Accounts/metadata/studio.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
$GLOBALS['studioDefs']['Accounts'] = array(
|
||||
'LBL_DETAILVIEW'=>array(
|
||||
'template'=>'xtpl',
|
||||
'template_file'=>'modules/Accounts/DetailView.html',
|
||||
'php_file'=>'modules/Accounts/DetailView.php',
|
||||
'type'=>'DetailView',
|
||||
),
|
||||
'LBL_EDITVIEW'=>array(
|
||||
'template'=>'xtpl',
|
||||
'template_file'=>'modules/Accounts/EditView.html',
|
||||
'php_file'=>'modules/Accounts/EditView.php',
|
||||
'type'=>'EditView',
|
||||
),
|
||||
'LBL_LISTVIEW'=>array(
|
||||
'template'=>'listview',
|
||||
'meta_file'=>'modules/Accounts/listviewdefs.php',
|
||||
'type'=>'ListView',
|
||||
),
|
||||
'LBL_SEARCHFORM'=>array(
|
||||
'template'=>'xtpl',
|
||||
'template_file'=>'modules/Accounts/SearchForm.html',
|
||||
'php_file'=>'modules/Accounts/ListView.php',
|
||||
'type'=>'SearchForm',
|
||||
),
|
||||
|
||||
);
|
||||
267
modules/Accounts/metadata/subpaneldefs.php
Normal file
267
modules/Accounts/metadata/subpaneldefs.php
Normal file
@@ -0,0 +1,267 @@
|
||||
<?php
|
||||
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
|
||||
die ( 'Not A Valid Entry Point' );
|
||||
/**
|
||||
* *******************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc.
|
||||
* Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
* ******************************************************************************
|
||||
*/
|
||||
|
||||
$layout_defs ['Accounts'] = array (
|
||||
// list of what Subpanels to show in the DetailView
|
||||
'subpanel_setup' => array (
|
||||
|
||||
'contacts' => array (
|
||||
'order' => 10,
|
||||
'module' => 'Contacts',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'last_name, first_name',
|
||||
'subpanel_name' => 'ForAccounts',
|
||||
'get_subpanel_data' => 'contacts',
|
||||
'add_subpanel_data' => 'contact_id',
|
||||
'title_key' => 'Kontakty',
|
||||
'top_buttons' => array (
|
||||
// array('widget_class' => 'SubPanelTopCreateAccountNameButton'),
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopSelectButton',
|
||||
'mode' => 'MultiSelect'
|
||||
),
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopCreateButton'
|
||||
)
|
||||
)
|
||||
|
||||
),
|
||||
'activities' => array (
|
||||
'order' => 40,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'date_start',
|
||||
'title_key' => 'LBL_ACTIVITIES_SUBPANEL_TITLE',
|
||||
'type' => 'collection',
|
||||
'subpanel_name' => 'activities', // this values is not associated with a physical file.
|
||||
'header_definition_from_subpanel' => 'meetings',
|
||||
'module' => 'Activities',
|
||||
|
||||
'top_buttons' => array (
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopCreateTaskButton'
|
||||
),
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopScheduleMeetingButton'
|
||||
),
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopScheduleCallButton'
|
||||
)
|
||||
),
|
||||
|
||||
'collection_list' => array (
|
||||
'tasks' => array (
|
||||
'module' => 'Tasks',
|
||||
'subpanel_name' => 'ForActivities',
|
||||
'get_subpanel_data' => 'tasks'
|
||||
),
|
||||
'meetings' => array (
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForActivities',
|
||||
'get_subpanel_data' => 'meetings'
|
||||
),
|
||||
'calls' => array (
|
||||
'module' => 'Calls',
|
||||
'subpanel_name' => 'ForActivities',
|
||||
'get_subpanel_data' => 'calls'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'history' => array (
|
||||
'order' => 20,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'date_modified',
|
||||
'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE',
|
||||
'type' => 'collection',
|
||||
'subpanel_name' => 'history', // this values is not associated with a physical file.
|
||||
|
||||
'header_definition_from_subpanel' => 'meetings',
|
||||
|
||||
'module' => 'History',
|
||||
|
||||
'top_buttons' => array (
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopCreateNoteButton'
|
||||
)
|
||||
|
||||
),
|
||||
|
||||
'collection_list' => array (
|
||||
'tasks' => array (
|
||||
'module' => 'Tasks',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'tasks'
|
||||
),
|
||||
|
||||
'meetings' => array (
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'meetings'
|
||||
),
|
||||
'calls' => array (
|
||||
'module' => 'Calls',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'calls'
|
||||
),
|
||||
|
||||
'notes' => array (
|
||||
'module' => 'Notes',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'notes'
|
||||
),
|
||||
|
||||
'linkedemails' => array (
|
||||
'module' => 'Emails',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'function:get_unlinked_email_query',
|
||||
'generate_select' => true,
|
||||
'function_parameters' => array (
|
||||
'return_as_array' => 'true'
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
/*
|
||||
'documents' => array(
|
||||
'order' => 30,
|
||||
'module' => 'Documents',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'documents',
|
||||
'title_key' => 'Dokumenty',
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
),
|
||||
*/
|
||||
'documents' => array (
|
||||
'order' => 130,
|
||||
'module' => 'Documents',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'documents',
|
||||
'title_key' => 'Dokumenty'
|
||||
),
|
||||
'ecmproducts' => array (
|
||||
'order' => 120,
|
||||
'module' => 'EcmProducts',
|
||||
'subpanel_name' => 'ForAccountsSale',
|
||||
'get_subpanel_data' => 'function:get_unlinked_product_query',
|
||||
'title_key' => 'Zakupione produkty',
|
||||
'generate_select' => true,
|
||||
'function_parameters' => array (
|
||||
'return_as_array' => 'true'
|
||||
)
|
||||
),
|
||||
|
||||
'ecminvoiceouts' => array (
|
||||
'order' => 60,
|
||||
'module' => 'EcmInvoiceOuts',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecminvoiceouts',
|
||||
'add_subpanel_data' => 'ecminvoiceout_id',
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'register_date',
|
||||
'title_key' => 'Faktury',
|
||||
'top_buttons' => array (
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopCreateButton'
|
||||
)
|
||||
)
|
||||
),
|
||||
'ecmprepaymentinvoices' => array (
|
||||
'order' => 70,
|
||||
'module' => 'EcmPrepaymentInvoices',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecmprepaymentinvoices',
|
||||
|
||||
'title_key' => 'Faktury zaliczkowe',
|
||||
'top_buttons' => array (
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopCreateButton'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'ecmquotes' => array (
|
||||
'order' => 80,
|
||||
'module' => 'EcmQuotes',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecmquotes',
|
||||
'add_subpanel_data' => 'ecmquote_id',
|
||||
'title_key' => 'LBL_ECMQUOTES_SUBPANEL_TITLE',
|
||||
'top_buttons' => array (
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopCreateButton'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'ecmstockdocins' => array (
|
||||
'order' => 100,
|
||||
'module' => 'EcmStockDocIns',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecmstockdocins',
|
||||
'add_subpanel_data' => 'ecmstockdocin_id',
|
||||
'title_key' => 'Dokument PZ',
|
||||
'top_buttons' => array (
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopCreateButton'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'ecmsales' => array (
|
||||
'order' => 90,
|
||||
'module' => 'EcmSales',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecmsales',
|
||||
'add_subpanel_data' => 'ecmsale_id',
|
||||
'title_key' => 'LBL_ECMSALES_SUBPANEL_TITLE',
|
||||
'top_buttons' => array (
|
||||
array (
|
||||
'widget_class' => 'SubPanelTopCreateButton'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
);
|
||||
?>
|
||||
76
modules/Accounts/metadata/subpanels/ForEmails.php
Normal file
76
modules/Accounts/metadata/subpanels/ForEmails.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Accounts'),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
'list_fields' => array(
|
||||
'name' => array(
|
||||
'vname' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '45%',
|
||||
),
|
||||
'billing_address_city' => array(
|
||||
'vname' => 'LBL_LIST_CITY',
|
||||
'width' => '27%',
|
||||
),
|
||||
'phone_office' => array(
|
||||
'vname' => 'LBL_LIST_PHONE',
|
||||
'width' => '20%',
|
||||
),
|
||||
'edit_button' => array(
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'width' => '4%',
|
||||
),
|
||||
'remove_button' => array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'width' => '4%',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
81
modules/Accounts/metadata/subpanels/ForProspectLists.php
Normal file
81
modules/Accounts/metadata/subpanels/ForProspectLists.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Accounts'),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
|
||||
'list_fields' => array(
|
||||
'name' => array(
|
||||
'vname' => 'LBL_LIST_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '25%',
|
||||
),
|
||||
'phone_office' => array(
|
||||
'vname' => 'LBL_LIST_PHONE',
|
||||
'width' => '20%',
|
||||
),
|
||||
'email1' => array(
|
||||
'vname' => 'LBL_LIST_EMAIL',
|
||||
'widget_class' => 'SubPanelEmailLink',
|
||||
'width' => '20%',
|
||||
),
|
||||
'assigned_user_name' => array(
|
||||
'vname' => 'LBL_ASSIGNED_TO',
|
||||
'width' => '20%',
|
||||
),
|
||||
'edit_button' => array(
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'width' => '4%',
|
||||
),
|
||||
'remove_button' => array(
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'width' => '4%',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
93
modules/Accounts/metadata/subpanels/default.php
Normal file
93
modules/Accounts/metadata/subpanels/default.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'Accounts'),
|
||||
),
|
||||
|
||||
'where' => '',
|
||||
|
||||
'list_fields' => array (
|
||||
'name' =>
|
||||
array (
|
||||
'vname' => 'LBL_LIST_ACCOUNT_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '45%',
|
||||
'default' => true,
|
||||
),
|
||||
'billing_address_city' =>
|
||||
array (
|
||||
'vname' => 'LBL_LIST_CITY',
|
||||
'width' => '20%',
|
||||
'default' => true,
|
||||
),
|
||||
'billing_address_country' =>
|
||||
array (
|
||||
'type' => 'varchar',
|
||||
'vname' => 'LBL_BILLING_ADDRESS_COUNTRY',
|
||||
'width' => '7%',
|
||||
'default' => true,
|
||||
),
|
||||
'phone_office' =>
|
||||
array (
|
||||
'vname' => 'LBL_LIST_PHONE',
|
||||
'width' => '20%',
|
||||
'default' => true,
|
||||
),
|
||||
'edit_button' =>
|
||||
array (
|
||||
'vname' => 'LBL_EDIT_BUTTON',
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'width' => '4%',
|
||||
'default' => true,
|
||||
),
|
||||
|
||||
'remove_button' =>
|
||||
array (
|
||||
'vname' => 'LBL_REMOVE',
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'width' => '4%',
|
||||
'default' => true,
|
||||
),
|
||||
|
||||
)
|
||||
);
|
||||
?>
|
||||
13
modules/Accounts/numerj.php
Normal file
13
modules/Accounts/numerj.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
$db=$GLOBALS['db'];
|
||||
$number=1001;
|
||||
$query="select id from accounts where deleted=0";
|
||||
$zap=$db->query($query);
|
||||
while($dane=$db->fetchByAssoc($zap)){
|
||||
$a = new Account();
|
||||
$a->retrieve($dane['id']);
|
||||
$a->ks_account=$number;
|
||||
$a->save();
|
||||
$number++;
|
||||
}
|
||||
?>
|
||||
85
modules/Accounts/previewPDF.php
Normal file
85
modules/Accounts/previewPDF.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
error_reporting(E_PARSE | E_WARNING);
|
||||
|
||||
$json = getJSONobj();
|
||||
$pll = array();
|
||||
$i = 0;
|
||||
while (isset($_POST['p_' . $i])) {
|
||||
$pll[] = $json->decode(htmlspecialchars_decode($_POST['p_' . $i]));
|
||||
$_POST['p_' . $i] = '';
|
||||
$i++;
|
||||
}
|
||||
$_POST = $json->decode(htmlspecialchars_decode($_POST['otherFormData']));
|
||||
$_POST['position_list'] = $pll;
|
||||
|
||||
if (isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $_REQUEST['cache'] != "fromJava") {
|
||||
require_once("modules/Accounts/Account.php");
|
||||
|
||||
$focus = new Account();
|
||||
|
||||
$method = (isset($_REQUEST['method']) && $_REQUEST['method'] != '') ? $_REQUEST['method'] : 'D';
|
||||
|
||||
$focus->getPDF($_REQUEST['record'], $method, null, @$_REQUEST['type']);
|
||||
} else
|
||||
|
||||
if ($_REQUEST['cache'] == "fromJava" && $_GET['from'] != "EcmInvoiceOuts") {
|
||||
$_SESSION['PDF_ECMINVOICEOUTS'] = $_POST;
|
||||
} else
|
||||
|
||||
if ($_GET['from'] == "EcmInvoiceOuts") {
|
||||
require_once("modules/EcmInvoiceOuts/EcmInvoiceOut.php");
|
||||
|
||||
$focus = new EcmInvoiceOut();
|
||||
|
||||
if (isset($_SESSION['PDF_ECMINVOICEOUTS']['record']) && $_SESSION['PDF_ECMINVOICEOUTS']['record'] != '') {
|
||||
|
||||
$focus->retrieve($_SESSION['PDF_ECMINVOICEOUTS']['record']);
|
||||
}
|
||||
|
||||
if (!$focus->ACLAccess('Save')) {
|
||||
|
||||
ACLController::displayNoAccess(true);
|
||||
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
|
||||
foreach ($focus->column_fields as $field) {
|
||||
|
||||
if (isset($_SESSION['PDF_ECMINVOICEOUTS'][$field])) {
|
||||
|
||||
$value = $_SESSION['PDF_ECMINVOICEOUTS'][$field];
|
||||
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($focus->additional_column_fields as $field) {
|
||||
|
||||
if (isset($_SESSION['PDF_ECMINVOICEOUTS'][$field])) {
|
||||
|
||||
$value = $_SESSION['PDF_ECMINVOICEOUTS'][$field];
|
||||
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_SESSION['PDF_ECMINVOICEOUTS']['to_is_vat_free']) && $_SESSION['PDF_ECMINVOICEOUTS']['to_is_vat_free'])
|
||||
$focus->to_is_vat_free = 1;
|
||||
else
|
||||
$focus->to_is_vat_free = 0;
|
||||
|
||||
$json = getJSONobj();
|
||||
|
||||
$pl = $_SESSION['PDF_ECMINVOICEOUTS']['position_list'];
|
||||
|
||||
$focus->position_list = $pl;
|
||||
|
||||
$focus->document_no = $_SESSION['PDF_ECMINVOICEOUTS']['document_no'];
|
||||
|
||||
$focus->wz_id = $_SESSION['PDF_ECMINVOICEOUTS']['out_id'];
|
||||
|
||||
$focus->ecmpaymentcondition_text = EcmInvoiceOut::getTranslation('EcmPaymentConditions', $focus->ecmpaymentcondition_id, $focus->ecmlanguage);
|
||||
//die();
|
||||
$focus->getPDF();
|
||||
}
|
||||
22
modules/Accounts/repairDoubleNames.php
Normal file
22
modules/Accounts/repairDoubleNames.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$query = "SELECT id, name FROM ecmproducts";
|
||||
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
|
||||
$ile =0;
|
||||
$ile_nie =0;
|
||||
while ($row=$GLOBALS['db']->fetchByAssoc($result)) {
|
||||
$name = $row['name'];
|
||||
if (strlen($name) % 2 == 0) {
|
||||
$start = substr($name, 0, strlen($name)/2);
|
||||
$end = substr($name, strlen($name)/2, strlen($name)/2);
|
||||
|
||||
if ($start == $end) {
|
||||
$query2 = "UPDATE ecmproducts SET name = '".$start."' WHERE id ='".$row['id']."';";
|
||||
//$GLOBALS['db']->query($query2);
|
||||
echo $query2."<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "koniec";
|
||||
?>
|
||||
133
modules/Accounts/share.php
Normal file
133
modules/Accounts/share.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
if (! defined('sugarEntry') || ! sugarEntry)
|
||||
die('Not A Valid Entry Point');
|
||||
if (! isset($_REQUEST['uid']))
|
||||
die('Nie wybrano kontrahentów');
|
||||
|
||||
$users = array();
|
||||
$accounts = explode(",", $_REQUEST['uid']);
|
||||
$account_list = array();
|
||||
$error = '';
|
||||
$db = $GLOBALS['db'];
|
||||
global $sugar_config, $current_user;
|
||||
|
||||
$arr=array('421173b5deee25c1329ab6b5877534e2','d711ec8a23fbf72cf82ea4edd60f0d27','4267b9fbbf8c0676ef9f947951dad3c3','d711ec8a23fbf72cf82ea4edd60f0d27','da619dbb95ec3b7a8c177947a6912a9b',
|
||||
'819d323467218194d783f397118d4c59'
|
||||
);
|
||||
if(in_array($current_user->id,$arr)){
|
||||
$users = array(
|
||||
'preDb_41665e296294da87d5ccf525912d9f55' => array(
|
||||
'name' => 'Asaj Sp. z o.o.',
|
||||
'dbasename' => 'preDb_41665e296294da87d5ccf525912d9f55'
|
||||
),
|
||||
'preDb_3406858f996aa369f185d5885f57a3ab' => array(
|
||||
'name' => 'Foto Land sp. j.',
|
||||
'dbasename' => 'preDb_3406858f996aa369f185d5885f57a3ab'
|
||||
),
|
||||
'preDb_49d2729a9cef4fbd51f87c458da576fa' => array(
|
||||
'name' => 'B. Licht GmbH',
|
||||
'dbasename' => 'preDb_49d2729a9cef4fbd51f87c458da576fa'
|
||||
),
|
||||
'preDb_5d907e51714c4030c6454a19a5403cf3' => array(
|
||||
'name' => 'Patio Dystrybucja sp. zo.o.',
|
||||
'dbasename'=>'preDb_5d907e51714c4030c6454a19a5403cf3'
|
||||
),
|
||||
'preDb_9865dd27d666f40fa4742496ec188187' => array(
|
||||
'name' => 'ASTRA S.A.',
|
||||
'dbasename'=>'preDb_9865dd27d666f40fa4742496ec188187'
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
$users = array(
|
||||
'preDb_577bab27048e83121574ddb97f22be59' => array(
|
||||
'name' => 'E5 Polska sp. z o.o.',
|
||||
'dbasename' => 'preDb_577bab27048e83121574ddb97f22be59'
|
||||
),
|
||||
'preDb_5b474e6d65c1f57c0b93064febee44c7' => array(
|
||||
'name' => 'Klanad sp. z o.o.',
|
||||
'dbasename' => 'preDb_5b474e6d65c1f57c0b93064febee44c7'
|
||||
),
|
||||
'preDb_a8fb05ea688ef8d7d0385b1e535e9dba' => array(
|
||||
'name' => 'BDG Maria Daniszewska',
|
||||
'dbasename' => 'preDb_a8fb05ea688ef8d7d0385b1e535e9dba'
|
||||
),
|
||||
'preDb_b6959b21151eecc7295367a46fdaf586' => array(
|
||||
'name' => 'PPH Tektor s.c. A.J.J. Zjawiony',
|
||||
'dbasename'=>'preDb_b6959b21151eecc7295367a46fdaf586'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($accounts as $account) {
|
||||
$ac = new Account();
|
||||
$ac->retrieve($account);
|
||||
if ($ac->id == '')
|
||||
continue;
|
||||
$addTmp = array();
|
||||
$addTmp['name'] = $ac->name;
|
||||
$addTmp['id'] = $ac->id;
|
||||
$account_list[] = $addTmp;
|
||||
}
|
||||
|
||||
$added='';
|
||||
if (isset($_POST['submit'])) {
|
||||
if (count($_POST['users']) > 0) {
|
||||
foreach ($_POST['users'] as $user) {
|
||||
if ($user != '' && $users[$user]['dbasename']==$user) {
|
||||
foreach ($account_list as $key => $val) {
|
||||
if ($val['id'] != '') {
|
||||
$zap = $db->query(
|
||||
"select * from accounts where id='" . $val['id'] .
|
||||
"'");
|
||||
$dane = $db->fetchByAssoc($zap);
|
||||
$toinst = array();
|
||||
$name=$dane['name'];
|
||||
$id=$dane['id'];
|
||||
foreach ($dane as $klucz => $wartosc) {
|
||||
$toinst[] = $wartosc;
|
||||
}
|
||||
$insert = "insert into accounts values ('" .
|
||||
implode("','", $toinst) . "')";
|
||||
|
||||
$link = mysql_connect(
|
||||
$sugar_config['dbconfig']['db_host_name'],
|
||||
$sugar_config['dbconfig']['db_user_name'],
|
||||
$sugar_config['dbconfig']['db_password']);
|
||||
mysql_select_db($user,
|
||||
$link);
|
||||
$res2=mysql_query('select id from accounts where id="'.$id.'"',$link);
|
||||
|
||||
if(!(mysql_num_rows($res2)>0)){
|
||||
$added=1;
|
||||
$res = mysql_query($insert, $link);
|
||||
|
||||
} else {
|
||||
echo "<span style='color:red'>Kontrahent jest juz udostępniony ".$dane['name'].' w firmie '.$users[$user]['name'].'</span><br>';
|
||||
}
|
||||
|
||||
|
||||
mysql_close($link);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$ss = new Sugar_Smarty();
|
||||
$ss->assign('uid', $_REQUEST['uid']);
|
||||
$ss->assign('body', $_REQUEST['body']);
|
||||
$ss->assign('error', $error);
|
||||
$ss->assign('success', $success);
|
||||
$ss->assign('added', $added);
|
||||
$ss->assign('users', $users);
|
||||
$ss->assign('account_list', $account_list);
|
||||
|
||||
$content = $ss->fetch('modules/Accounts/tpls/share.tpl');
|
||||
|
||||
echo $content;
|
||||
|
||||
30
modules/Accounts/showMap.php
Normal file
30
modules/Accounts/showMap.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
//map container
|
||||
echo '<div id="googleMapContainer" style="width:750px;height:570px;"></div>';
|
||||
//load Script
|
||||
echo '<script type="text/javascript" src="modules/Accounts/js/showMap.js"></script>';
|
||||
echo '<script src="https://maps.googleapis.com/maps/api/js"></script>';
|
||||
$ids = explode(",",$_REQUEST['uid']);
|
||||
//get Data
|
||||
$markers = array();
|
||||
foreach ($ids as $id) {
|
||||
$a = new Account();
|
||||
$a->retrieve($id);
|
||||
$addr = $a->register_address_street." ".$a->register_address_postalcode." ".$a->register_address_city." ".$a->register_address_country;
|
||||
$cor = getCoordinates($addr);
|
||||
$tmp = array();
|
||||
$tmp['lat'] = $cor[0];
|
||||
$tmp['lng'] = $cor[1];
|
||||
$tmp['title'] = html_entity_decode(trim($a->name));
|
||||
$tmp['info'] = '<a href="index.php?module=Accounts&action=DetailView&record='.$a->id.'" target="new">'.html_entity_decode(trim($a->name)).'</a><br>'.$a->register_address_street.'<br>'.$a->register_address_postalcode.'<br>'.$a->register_address_city.'<br>'.$a->register_address_country;
|
||||
$markers[] = $tmp;
|
||||
}
|
||||
echo '<input value="'.base64_encode(json_encode($markers)).'" id="googleMapMarkers" type="hidden"></input>';
|
||||
function getCoordinates($address){
|
||||
$address = str_replace(" ", "+", $address); // replace all the white space with "+" sign to match with google search pattern
|
||||
$url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address";
|
||||
$response = file_get_contents($url);
|
||||
$json = json_decode($response,TRUE); //generate array object from the response from the web
|
||||
return array ($json['results'][0]['geometry']['location']['lat'],$json['results'][0]['geometry']['location']['lng']);
|
||||
}
|
||||
?>
|
||||
383
modules/Accounts/test.php
Normal file
383
modules/Accounts/test.php
Normal file
@@ -0,0 +1,383 @@
|
||||
<?php
|
||||
echo 'dupcia';
|
||||
ini_set('display_errors',1);
|
||||
error_reporting(E_ALL);
|
||||
echo 'error!';
|
||||
class Mailing {
|
||||
public $db;
|
||||
public $pdfMerge;
|
||||
public $contentTpl = 'modules/EcmAgreements/tpl/emailContent.html';
|
||||
public $accounts;
|
||||
public function __construct() {
|
||||
$this->db = $GLOBALS ['db'];
|
||||
$this->pdfMerge = new PDFMerger ();
|
||||
}
|
||||
|
||||
public function getAccounts() {
|
||||
$r = $this->db->query ( "select parent_id from ecminvoiceouts where payment_date<='" . date ( "Y-m-t" ) . "' and payment_date>='" . date ( "Y-m-01" ) . "' group by parent_id" );
|
||||
$this->accounts = array();
|
||||
while ( $dane = $this->db->fetchByAssoc ( $r ) ) {
|
||||
$this->accounts [] = $dane;
|
||||
}
|
||||
}
|
||||
|
||||
public function generateEmails() {
|
||||
foreach ( $this->accounts as $account ) {
|
||||
$acc = new Account ();
|
||||
$acc->retrieve ( $account );
|
||||
if ($acc->only_invoice == 1) {
|
||||
$transactions = $this->getOnlyInvoiceTransactions ( $account );
|
||||
$saldo = null;
|
||||
} else {
|
||||
$transactions = $this->getAccountTransactions ( $account );
|
||||
$saldo = $this->getPdfForAccount ( $transactions, $acc );
|
||||
}
|
||||
|
||||
$invoiceFiles = $this->getInvoiceFiles ( $account );
|
||||
|
||||
$endingAgreements = $this->getEndingAgreements ( $account );
|
||||
|
||||
$this->sendMessage ( $acc, $transactions, $invoiceFiles, $endingAgreements, $saldo );
|
||||
}
|
||||
}
|
||||
public function getPdfForAccount($transactions, $acc) {
|
||||
$total_w_war = 0;
|
||||
$total_w_nieroz = 0;
|
||||
$total_w_roz = 0;
|
||||
|
||||
foreach ( $transactions as $transaction ) {
|
||||
$total_w_war = $total_w_war + $transaction ['value'];
|
||||
$total_w_nieroz = $total_w_nieroz + ($transaction ['value'] - $transaction ['total_settled']);
|
||||
$total_w_roz = $total_w_roz + $transaction ['total_settled'];
|
||||
}
|
||||
|
||||
$ss = new Sugar_Smarty ();
|
||||
global $mod_strings;
|
||||
$ss->assign ( "MOD", $mod_strings );
|
||||
|
||||
global $app_strings;
|
||||
$ss->assign ( "APP", $app_strings );
|
||||
|
||||
$ss->assign ( 'SUM', $sum );
|
||||
$ss->assign ( 'umowy', getAgreements ( $account_id ) );
|
||||
$ss->assign ( 'umowa_sel', $umowa_id );
|
||||
$ss->assign ( 'SWITCH_SHOW', $_REQUEST ['switch_show'] );
|
||||
$ss->assign ( 'PROCESS', '1' );
|
||||
$ss->assign ( 'ACCOUNT', array (
|
||||
'ID' => $acc->id,
|
||||
'NAME' => $acc->name
|
||||
) );
|
||||
|
||||
$ss->assign ( 'total_w_war', $total_w_war );
|
||||
$ss->assign ( 'total_w_nieroz', $total_w_nieroz );
|
||||
$ss->assign ( 'total_w_roz', $total_w_roz );
|
||||
|
||||
$ss->assign ( 'WINIEN', $transactions );
|
||||
|
||||
ob_clean ();
|
||||
$output = $ss->fetch ( 'modules/EcmPaymentStates/tpls/PDF/AccountPaymentStatespdf.tpl' );
|
||||
include_once ("include/MPDF57/mpdf.php");
|
||||
unset ( $smarty );
|
||||
$p = new mPDF ( '', 'A4', null, 'helvetica', 10, 10, 25, 10, 5, 5 );
|
||||
// $p->setFooter('Strona {PAGENO} z {nbpg}');
|
||||
$p->SetHTMLHeader ( '<table style="width:100%;"><tr><td style="text-align:left;font-size: 10px;width:50%;">BILANS B. Pietras E. Pietras Spółka Jawna<br>
|
||||
Rozrachunki: ' . $a->name . '<br>Data wydruku: ' . date ( "d.m.Y" ) . '<br>Strona {PAGENO} z {nbpg}</td>
|
||||
<td style="text-align:left;font-size: 10px;width:50%;">' . $a->name . '<br>' . $a->register_address_street . '
|
||||
<br>' . $a->register_address_postalcode . ',
|
||||
' . $a->register_address_city . '<br>NIP: ' . $a->to_vatid . '</td></tr></table>' );
|
||||
// $p->setTitle($mod_strings["LBL_REPORT_STOCKS_DOCS"]);
|
||||
// echo $output;
|
||||
$p->writeHTML ( $output );
|
||||
|
||||
if (count ( $transactions ) > 0) {
|
||||
$p->Output ( 'upload/rozrachunki.pdf', 'F' );
|
||||
return 'upload/rozrachunki.pdf';
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public function getOnlyInvoiceTransactions($id) {
|
||||
$ecmInvoiceOut = new EcmInvoiceout ();
|
||||
$results = $ecmInvoiceOut->get_full_list ( null, "parent_id='" . $id . "' and payment_date>='" . date ( "Y-m-01" ) . "' and payment_date<='" . date ( "Y-m-t" ) . "'" );
|
||||
$ids = array();
|
||||
$agreement = array();
|
||||
foreach ( $results as $result ) {
|
||||
$ids [] = $result->id;
|
||||
$agreement [] = $result->agreement_id;
|
||||
}
|
||||
|
||||
$zap = "select payment_date,ecmagreement_id from ecmagreementitems where deleted=0 and ecmagreement_id in ('" . implode ( "','", $agreement ) . "') and payment_date>='" . date ( "Y-m-01" ) . "' and payment_date<='" . date ( "Y-m-t" ) . "'";
|
||||
|
||||
$z = $this->db->query ( $zap );
|
||||
|
||||
$raty_kap = array();
|
||||
while ( $r = $this->db->fetchByAssoc ( $z ) ) {
|
||||
$rr = $this->db->query ( "select id from ecmtransactions where record_id='" . $r ['ecmagreement_id'] . "' and deleted=0 and name like 'Rata kapitałowa do umowy:%' and payment_date='" . $r ['payment_date'] . "'" );
|
||||
$dane = $this->db->fetchByAssoc ( $rr );
|
||||
$raty_kap [] = $dane ['id'];
|
||||
}
|
||||
|
||||
if (count ( $raty_kap ) > 0) {
|
||||
$kap = "id in ('" . implode ( "','", $raty_kap ) . "')";
|
||||
} else {
|
||||
$kap = "";
|
||||
}
|
||||
|
||||
$query = "select * from ecmtransactions where record_id in ('" . implode ( "','", $ids ) . "') " . $kap . " and deleted=0 group by id";
|
||||
|
||||
$res = $this->db->query ( $query );
|
||||
$transactions = array();
|
||||
$transactions = array();
|
||||
while ( $r = $this->db->fetchByAssoc ( $res ) ) {
|
||||
$r ['total_settled'] = 0;
|
||||
$r = $this->getSettledTransactionsValue ( $r );
|
||||
$transactions [] = $r;
|
||||
}
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
public function getInvoiceFiles($id) {
|
||||
include_once "modules/EcmInvoiceOuts/createPDF.php";
|
||||
$ecmInvoiceOut = new EcmInvoiceout ();
|
||||
$results = $ecmInvoiceOut->get_full_list ( null, "parent_id='" . $id . "' and payment_date>='" . date ( "Y-m-01" ) . "' and payment_date<='" . date ( "Y-m-t" ) . "'" );
|
||||
|
||||
$files = array();
|
||||
foreach ( $results as $result ) {
|
||||
$path = 'upload/fk_' . str_replace ( '/', '', (str_replace ( ' ', '', $result->document_no )) ) . '.pdf';
|
||||
|
||||
$name = createEcmInvoiceOutPdf ( $result->id, 'FILE' );
|
||||
|
||||
$files [] = $name;
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
function dateV($format, $timestamp = null) {
|
||||
$to_convert = array (
|
||||
'l' => array (
|
||||
'dat' => 'N',
|
||||
'str' => array (
|
||||
'Poniedziałek',
|
||||
'Wtorek',
|
||||
'Środa',
|
||||
'Czwartek',
|
||||
'Piątek',
|
||||
'Sobota',
|
||||
'Niedziela'
|
||||
)
|
||||
),
|
||||
'F' => array (
|
||||
'dat' => 'n',
|
||||
'str' => array (
|
||||
'styczeń',
|
||||
'luty',
|
||||
'marzec',
|
||||
'kwiecień',
|
||||
'maj',
|
||||
'czerwiec',
|
||||
'lipiec',
|
||||
'sierpień',
|
||||
'wrzesień',
|
||||
'październik',
|
||||
'listopad',
|
||||
'grudzień'
|
||||
)
|
||||
),
|
||||
'f' => array (
|
||||
'dat' => 'n',
|
||||
'str' => array (
|
||||
'stycznia',
|
||||
'lutego',
|
||||
'marca',
|
||||
'kwietnia',
|
||||
'maja',
|
||||
'czerwca',
|
||||
'lipca',
|
||||
'sierpnia',
|
||||
'września',
|
||||
'października',
|
||||
'listopada',
|
||||
'grudnia'
|
||||
)
|
||||
)
|
||||
);
|
||||
if ($pieces = preg_split ( '#[:/.\-, ]#', $format )) {
|
||||
if ($timestamp === null) {
|
||||
$timestamp = time ();
|
||||
}
|
||||
foreach ( $pieces as $datepart ) {
|
||||
if (array_key_exists ( $datepart, $to_convert )) {
|
||||
$replace [] = $to_convert [$datepart] ['str'] [(date ( $to_convert [$datepart] ['dat'], $timestamp ) - 1)];
|
||||
} else {
|
||||
$replace [] = date ( $datepart, $timestamp );
|
||||
}
|
||||
}
|
||||
$result = strtr ( $format, array_combine ( $pieces, $replace ) );
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
public function getEmailTitle($acc) {
|
||||
return $title = "Faktury za m-c " . $this->dateV ( 'F', strtotime ( date ( 'Y-m-t' ) ) ) . ' ' . $acc->parent_name . ' - BILANS B. Pietras E. Pietras Spółka Jawna';
|
||||
}
|
||||
|
||||
public function calculateTotal($transactions){
|
||||
$total=0;
|
||||
|
||||
foreach ($transactions as $transaction){
|
||||
$total=$total+($transaction ['value'] - $transaction ['total_settled']);
|
||||
}
|
||||
|
||||
return $total;
|
||||
}
|
||||
public function getEmailContent($acc,$transactions) {
|
||||
$ss = new Sugar_Smarty ();
|
||||
|
||||
$ss->assign("transactions",$transactions);
|
||||
$ss->assign("mc",$this->dateV ( 'F', strtotime ( date ( 'Y-m-t' ) ) ));
|
||||
$ss->assign("year",date('Y'));
|
||||
$ss->assign("total",$this->calculateTotal($transactions));
|
||||
|
||||
$content = $ss->fetch($this->contentTpl);
|
||||
|
||||
return $content;
|
||||
|
||||
}
|
||||
public function sendMessage($acc, $transactions, $files, $endingAgreements, $saldo) {
|
||||
require_once ("mailer/PHPMailerAutoload.php");
|
||||
|
||||
$mailClassS = new PHPMailer ();
|
||||
|
||||
$mailClassS->isSMTP (); // Set mailer to use SMTP
|
||||
$mailClassS->Host = '77.55.64.229'; // Specify main and backup server
|
||||
$mailClassS->SMTPAuth = true; // Enable SMTP authentication
|
||||
$mailClassS->Username = 'faktury@e-bilans.info'; // SMTP username
|
||||
$mailClassS->Password = 'FakturyInfo^'; // SMTP password
|
||||
$mailClassS->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
|
||||
$mailClassS->Port = 587; // Set the SMTP port number - 587 for
|
||||
|
||||
/*
|
||||
* foreach ($to as $ad=>$tit){
|
||||
*
|
||||
* $mailClassS->addAddress ($ad,$tit); // Add a
|
||||
*
|
||||
* }
|
||||
*/
|
||||
|
||||
$addressCC = "outtervision@gmail.com";
|
||||
$mailClassS->addBCC ( $addressCC, 'Dominik Brzóska' );
|
||||
|
||||
/*
|
||||
* $mailClassS->addCC('borkowskak@matbud-torun.pl', 'Katarzyna Borkowska');
|
||||
* $mailClassS->addCC('bogdanpietras@matbud-torun.pl', 'Bogdan Pietras');
|
||||
* $mailClassS->addCC('fakturywyslane@e-bilans.info', 'Faktury wysłane');
|
||||
*/
|
||||
|
||||
$mailClassS->Sender = 'faktury@e-bilans.info';
|
||||
$mailClassS->From = 'faktury@e-bilans.info';
|
||||
$mailClassS->FromName = 'BILANS B. Pietras E. Pietras Spółka Jawna';
|
||||
$mailClassS->WordWrap = 50; // Set word wrap to 50 characters
|
||||
|
||||
$mailClassS->isHTML ( true ); // Set email format to HTML
|
||||
|
||||
$mailClassS->Subject = $this->getEmailTitle ( $acc );
|
||||
|
||||
$mailClassS->Body = $this->getEmailContent($acc,$transactions);
|
||||
foreach ( $files as $path ) {
|
||||
|
||||
if (file_exists ( '/var/www/html/crm/' . $path )) {
|
||||
|
||||
$mailClassS->addAttachment ( '/var/www/html/crm/' . $path );
|
||||
}
|
||||
}
|
||||
|
||||
if ($saldo != null) {
|
||||
if (file_exists ( '/var/www/html/crm/' . $saldo )) {
|
||||
|
||||
$mailClassS->addAttachment ( '/var/www/html/crm/' . $saldo );
|
||||
}
|
||||
}
|
||||
|
||||
if (! $mailClassS->send ()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function getEndingAgreements($id) {
|
||||
$ecmAgreement = new EcmAgreement ();
|
||||
$results = $ecmAgreement->get_full_list ( null, "date_end>='" . date ( "Y-m-01" ) . "' and date_end<='" . date ( "Y-m-t" ) . "'" );
|
||||
|
||||
return $results;
|
||||
}
|
||||
public function getAccountTransactions($id) {
|
||||
$query = "
|
||||
SELECT * FROM ecmtransactions
|
||||
WHERE deleted='0' AND
|
||||
parent_id='" . $id . "'
|
||||
AND type='0' AND (settled='0' or settled=null)
|
||||
AND register_date > '2011-12-31' and payment_date <= '" . date ( "Y-m-t" ) . "'
|
||||
ORDER BY payment_date desc";
|
||||
|
||||
$res = $this->db->query ( $query );
|
||||
$transactions = array();
|
||||
while ( $r = $this->db->fetchByAssoc ( $res ) ) {
|
||||
$r ['total_settled'] = 0;
|
||||
$r = $this->getSettledTransactionsValue ( $r );
|
||||
$transactions [] = $r;
|
||||
}
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
public function getSettledTransactionsValue($record) {
|
||||
$rel = $this->db->query ( "SELECT * FROM ecmtransactions_rel WHERE ecmtransaction_a_id='" . $r ['id'] . "' OR ecmtransaction_b_id='" . $r ['id'] . "'" );
|
||||
while ( $rr = $this->db->fetchByAssoc ( $rel ) ) {
|
||||
if ($rr ['ecmtransaction_a_id'] == $r ['id'])
|
||||
$rel_id = $rr ['ecmtransaction_b_id'];
|
||||
else
|
||||
$rel_id = $rr ['ecmtransaction_a_id'];
|
||||
$t = $this->db->fetchByAssoc ( $this->db->query ( "SELECT * FROM ecmtransactions WHERE id='$rel_id' and deleted=0" ) );
|
||||
$tmp2 = array ();
|
||||
$tmp2 ['name'] = $t ['name'];
|
||||
$tmp2 ['trans_id'] = $t ['id'];
|
||||
$tmp2 ['value'] = $rr ['value'];
|
||||
if ($t ['type'] == 0 && $rel->num_rows == 1) {
|
||||
|
||||
if (abs ( $rr ['value'] ) == abs ( $r ['value'] )) {
|
||||
if ($r ['value'] > 0) {
|
||||
$rr ['value'] = abs ( $rr ['value'] );
|
||||
} else {
|
||||
$v = - 1 * abs ( $rr ['value'] );
|
||||
$rr ['value'] = $v;
|
||||
}
|
||||
} else {
|
||||
if ($r ['value'] > 0) {
|
||||
$rr ['value'] = abs ( $rr ['value'] );
|
||||
} else {
|
||||
$v = - 1 * abs ( $rr ['value'] );
|
||||
$rr ['value'] = $v;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
if (abs ( $rr ['value'] ) == abs ( $r ['value'] )) {
|
||||
if ($r ['value'] > 0) {
|
||||
$rr ['value'] = abs ( $rr ['value'] );
|
||||
} else {
|
||||
$v = - 1 * abs ( $rr ['value'] );
|
||||
$rr ['value'] = $v;
|
||||
}
|
||||
} else {
|
||||
if ($r ['value'] > 0) {
|
||||
$rr ['value'] = abs ( $rr ['value'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($t ['id'] == "")
|
||||
continue;
|
||||
$record ['total_settled'] += floatval ( $rr ['value'] );
|
||||
}
|
||||
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
echo 'error!';
|
||||
?>
|
||||
1074
modules/Accounts/vardefs.php
Normal file
1074
modules/Accounts/vardefs.php
Normal file
File diff suppressed because it is too large
Load Diff
260
modules/Accounts/views/view.detail.php
Normal file
260
modules/Accounts/views/view.detail.php
Normal file
@@ -0,0 +1,260 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
|
||||
require_once('include/MVC/View/views/view.detail.php');
|
||||
|
||||
class AccountsViewDetail extends ViewDetail {
|
||||
|
||||
|
||||
function AccountsViewDetail(){
|
||||
parent::ViewDetail();
|
||||
}
|
||||
|
||||
/**
|
||||
* display
|
||||
* Override the display method to support customization for the buttons that display
|
||||
* a popup and allow you to copy the account's address into the selected contacts.
|
||||
* The custom_code_billing and custom_code_register Smarty variables are found in
|
||||
* include/SugarFields/Fields/Address/DetailView.tpl (default). If it's a English U.S.
|
||||
* locale then it'll use file include/SugarFields/Fields/Address/en_us.DetailView.tpl.
|
||||
*/
|
||||
function display(){
|
||||
|
||||
if(empty($this->bean->id)){
|
||||
global $app_strings;
|
||||
sugar_die($app_strings['ERROR_NO_RECORD']);
|
||||
}
|
||||
global $mod_strings;
|
||||
//add mz
|
||||
$pl = $this->bean->showPositions();
|
||||
$pl2 = $this->bean->showPositions2();
|
||||
$pl3 = $this->bean->showPositions3();
|
||||
$pl4 = $this->bean->showPositions4();
|
||||
$ws = $this->bean->ShowWebSitesList();
|
||||
$ws2 = $this->bean->ShowTelephonesList();
|
||||
$this->ss->assign('WEBSITES_LIST', $ws);
|
||||
$this->ss->assign('TELEPHONES_LIST', $ws2);
|
||||
$this->ss->assign('POSITIONS', $pl);
|
||||
$this->ss->assign('POSITIONS2', $pl2);
|
||||
$this->ss->assign('POSITIONS3', $pl3);
|
||||
$this->ss->assign('POSITIONS4', $pl4);
|
||||
$this->ss->assign('LBL_PHONE', $app_strings['LBL_PHONE']);
|
||||
$this->ss->assign('LBL_FAX', $app_strings['LBL_FAX']);
|
||||
$this->ss->assign('LBL_SAVE_TO_GOOGLE', $mod_strings['LBL_SAVE_TO_GOOGLE']);
|
||||
|
||||
|
||||
$datachart = AnalysisProductSale($this->bean->id);
|
||||
//var_dump($data);
|
||||
$rows = array();
|
||||
foreach ($datachart as $key => $value) {
|
||||
$rows['netto'][] = $value['total_netto'];
|
||||
// $rows['total_brutto'][] = $value['total_brutto'];
|
||||
$rows['kupno'][] = $value['total_purchase'];
|
||||
$rows['marza'][] = $value['total_netto'] - $value['total_purchase'];
|
||||
$rows['marzaprocent'][] = (($value['total_netto'] - $value['total_purchase']) * 100) / $value['total_netto'];
|
||||
}
|
||||
|
||||
$this->ss->assign("DATACHART", $datachart);
|
||||
$this->ss->assign("ROWS", $rows);
|
||||
|
||||
//get salda ;)
|
||||
$saldo = $this->bean->getSalda(8);
|
||||
$today_saldo = $this->bean->getSalda(9);
|
||||
//end get salda
|
||||
if($saldo<0)$ss="<span style='color:red'>";$se="</span>";
|
||||
if($today_saldo<0)$ss="<span style='color:red'>";$se="</span>";
|
||||
|
||||
|
||||
$this->ss->assign('saldo', $ss.format_number($saldo).$se);
|
||||
$this->ss->assign('today_saldo', $ss.format_number($today_saldo).$se);
|
||||
//end mz
|
||||
$this->dv->process();
|
||||
global $mod_strings;
|
||||
if(ACLController::checkAccess('Contacts', 'edit', true)) {
|
||||
$push_billing = '<span class="id-ff"><button class="button btn_copy" title="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_LABEL'] .
|
||||
'" type="button" onclick=\'open_contact_popup("Contacts", 600, 600, "&account_name=' .
|
||||
urlencode($this->bean->name) . '&html=change_address' .
|
||||
'&primary_address_street=' . str_replace(array("\rn", "\r", "\n"), array('','','<br>'), urlencode($this->bean->billing_address_street)) .
|
||||
'&primary_address_city=' . $this->bean->billing_address_city .
|
||||
'&primary_address_state=' . $this->bean->billing_address_state .
|
||||
'&primary_address_postalcode=' . $this->bean->billing_address_postalcode .
|
||||
'&primary_address_country=' . $this->bean->billing_address_country .
|
||||
'", true, false);\' value="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_TITLE']. '">'.
|
||||
SugarThemeRegistry::current()->getImage("id-ff-copy","",null,null,'.png',$mod_strings["LBL_COPY"]).
|
||||
'</button></span>';
|
||||
|
||||
$push_register = '<span class="id-ff"><button class="button btn_copy" title="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_LABEL'] .
|
||||
'" type="button" onclick=\'open_contact_popup("Contacts", 600, 600, "&account_name=' .
|
||||
urlencode($this->bean->name) . '&html=change_address' .
|
||||
'&primary_address_street=' . str_replace(array("\rn", "\r", "\n"), array('','','<br>'), urlencode($this->bean->register_address_street)) .
|
||||
'&primary_address_city=' . $this->bean->register_address_city .
|
||||
'&primary_address_state=' . $this->bean->register_address_state .
|
||||
'&primary_address_postalcode=' . $this->bean->register_address_postalcode .
|
||||
'&primary_address_country=' . $this->bean->register_address_country .
|
||||
'", true, false);\' value="' . $mod_strings['LBL_PUSH_CONTACTS_BUTTON_TITLE'] . '">'.
|
||||
SugarThemeRegistry::current()->getImage("id-ff-copy",'',null,null,'.png',$mod_strings['LBL_COPY']).
|
||||
'</button></span>';
|
||||
} else {
|
||||
$push_billing = '';
|
||||
$push_register = '';
|
||||
}
|
||||
|
||||
$this->ss->assign("custom_code_billing", $push_billing);
|
||||
$this->ss->assign("custom_code_register", $push_register);
|
||||
|
||||
if(empty($this->bean->id)){
|
||||
global $app_strings;
|
||||
sugar_die($app_strings['ERROR_NO_RECORD']);
|
||||
}
|
||||
echo $this->dv->display();
|
||||
}
|
||||
}
|
||||
|
||||
function AnalysisProductSale($account_id) {
|
||||
global $db;
|
||||
|
||||
try {
|
||||
$tmp = new DateTime(date('Y-m-31'));
|
||||
$tmp2 = new DateTime(date('Y-m-01'));
|
||||
$tmp2->sub(new DateInterval('P11M'));
|
||||
$register_date_to = $tmp->format('Y-m-d');
|
||||
$register_date_from = $tmp2->format('Y-m-d');
|
||||
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$query = "
|
||||
SELECT
|
||||
p.id,
|
||||
p.old_ecminvoiceoutitem_id,
|
||||
p.quantity_corrected,
|
||||
p.total_brutto_corrected,
|
||||
p.total_netto_corrected,
|
||||
p.ecminvoiceout_id,
|
||||
p.ecmproduct_id,
|
||||
p.code, p.name,
|
||||
p.total_netto,
|
||||
p.total_brutto,
|
||||
p.price_purchase,
|
||||
p.quantity,
|
||||
i.register_date,
|
||||
i.type,
|
||||
i.currency_value,
|
||||
i.currency_value_nbp,
|
||||
i.currency_id
|
||||
FROM
|
||||
ecminvoiceoutitems p,
|
||||
ecminvoiceouts i
|
||||
WHERE
|
||||
i.canceled=0
|
||||
AND i.deleted=0
|
||||
AND i.register_date <= '" . $register_date_to . "'
|
||||
AND i.register_date >= '" . $register_date_from . "'
|
||||
AND p.ecminvoiceout_id = i.id
|
||||
AND i.parent_id='" . $account_id ."'
|
||||
ORDER BY
|
||||
i.register_date;" ;
|
||||
//die(1);
|
||||
//echo $query;
|
||||
|
||||
//echo $query;
|
||||
$result = $db->query($query);
|
||||
|
||||
$result2 = $db->query($query);
|
||||
if ($result2->num_rows > 0) {
|
||||
while ($row = $result2->fetch_assoc()) {
|
||||
$tmparray[$row['id']] = $row;
|
||||
}
|
||||
}
|
||||
if ($result->num_rows > 0) {
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$currency = 1;
|
||||
if($row['type']!='K'){
|
||||
if($row['currency_value']!=''&& $row['currency_value']!='0'){
|
||||
$currency = $row['currency_value'];
|
||||
}elseif($row['currency_value_nbp']!=''){
|
||||
$currency = $row['currency_value_nbp'];
|
||||
}
|
||||
}
|
||||
if($row['type']=='normal'){
|
||||
$return[substr($row['register_date'], 0, 7)]['total_purchase'] += round($row['price_purchase']* $row['quantity'],2);
|
||||
$return[substr($row['register_date'], 0, 7)]['total_netto'] += $row['total_netto']* $currency;
|
||||
}else{
|
||||
$return[substr($row['register_date'], 0, 7)]['total_purchase'] += round($tmparray[$row['old_ecminvoiceoutitem_id']]['price_purchase'] * $row['quantity_corrected'] ,2);
|
||||
$return[substr($row['register_date'], 0, 7)]['total_netto'] += $row['total_netto_corrected']* $currency;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
global $current_user;
|
||||
|
||||
if(count($return)<12){
|
||||
try {
|
||||
$currentDate = new DateTime(date('Y-m-01'));
|
||||
$date = new DateTime(date('Y-m-01'));
|
||||
$date->sub(new DateInterval('P11M'));
|
||||
$register_date_fill = $date->format('Y-m');
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
exit(1);
|
||||
}
|
||||
while(count($return)<12){
|
||||
// echo $date->format('Y-m').'<br>';
|
||||
if(!isset($return[$register_date_fill])){
|
||||
$return[$register_date_fill]['total_purchase'] = 0;
|
||||
$return[$register_date_fill]['total_netto'] = 0;
|
||||
}
|
||||
$date->add(new DateInterval('P1M'));
|
||||
$register_date_fill = $date->format('Y-m');
|
||||
}
|
||||
}
|
||||
|
||||
ksort($return);
|
||||
$formated_return;
|
||||
foreach ($return as $data => $row){
|
||||
$split = split("-",$data);
|
||||
$formated_return[$split[1] .".".$split[0]] = $row;
|
||||
}
|
||||
|
||||
return $formated_return;
|
||||
}
|
||||
?>
|
||||
53
modules/Accounts/views/view.edit.php
Normal file
53
modules/Accounts/views/view.edit.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
/*********************************************************************************
|
||||
* SugarCRM Community Edition is a customer relationship management program developed by
|
||||
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU Affero General Public License version 3 as published by the
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License along with
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA.
|
||||
*
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU Affero General Public License version 3.
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
* "Powered by SugarCRM".
|
||||
********************************************************************************/
|
||||
|
||||
require_once('include/MVC/View/views/view.edit.php');
|
||||
|
||||
class AccountsViewEdit extends ViewEdit
|
||||
{
|
||||
public function preDisplay() {
|
||||
require_once('modules/Accounts/EditView.php');
|
||||
parent::preDisplay();
|
||||
}
|
||||
|
||||
public function display()
|
||||
{
|
||||
parent::display();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user