init
This commit is contained in:
207
modules/Leads/views/view.detail.php
Normal file
207
modules/Leads/views/view.detail.php
Normal file
@@ -0,0 +1,207 @@
|
||||
<?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');
|
||||
include_once ("modules/EcmPaymentStates/helper.php");
|
||||
class LeadsViewDetail extends ViewDetail {
|
||||
|
||||
|
||||
function LeadsViewDetail(){
|
||||
parent::ViewDetail();
|
||||
}
|
||||
|
||||
/**
|
||||
* display
|
||||
* Override the display method to support customization for the buttons that display
|
||||
* a popup and allow you to copy the lead's address into the selected contacts.
|
||||
* The custom_code_billing and custom_code_shipping 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();
|
||||
$this->ss->assign('POSITIONS', $pl);
|
||||
$pl55 = $this->bean->showPositions55();
|
||||
$this->ss->assign('POSITIONS55', $pl55);
|
||||
$this->ss->assign('POSITIONS2', $pl2);
|
||||
$this->ss->assign('POSITIONS3', $pl3);
|
||||
$this->ss->assign('URL_ECMPAY', '<a href="index.php?module=EcmPaymentStates&action=index&return_module=EcmPaymentStates&return_action=DetailView&parentTab=Rozrachunki&lead_id='.$this->bean->id.'" target="_blank">Sprawdź</a>');
|
||||
$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']);
|
||||
$this->ss->assign('MOVE', '<input class="button" value="'.$mod_strings['LBL_MOVE_LEAD'].'" type="button" onClick="location.href=\'index.php?module=Leads&action=MoveLead&record='.$this->bean->id.'\'"/>');
|
||||
//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, "&lead_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_shipping = '<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, "&lead_name=' .
|
||||
urlencode($this->bean->name) . '&html=change_address' .
|
||||
'&primary_address_street=' . str_replace(array("\rn", "\r", "\n"), array('','','<br>'), urlencode($this->bean->shipping_address_street)) .
|
||||
'&primary_address_city=' . $this->bean->shipping_address_city .
|
||||
'&primary_address_state=' . $this->bean->shipping_address_state .
|
||||
'&primary_address_postalcode=' . $this->bean->shipping_address_postalcode .
|
||||
'&primary_address_country=' . $this->bean->shipping_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_shipping = '';
|
||||
}
|
||||
|
||||
$query = "select p.id,p.document_no,p.paid,p.register_date,p.payment_date,p.total,p.ecminvoiceout_id from ecmpayments_ecminvoiceouts as p inner join ecminvoiceouts as i on p.ecminvoiceout_id=i.id and i.type!='canceled' where p.deleted='0' and p.lead_id='" . $this->bean->id . "' " . $v . " order by p.date_entered desc";
|
||||
|
||||
$w = $GLOBALS ['db']->query ( $query );
|
||||
|
||||
$winien_roz = 0;
|
||||
$winien_n_roz = 0;
|
||||
while ( $r = $GLOBALS ['db']->fetchByAssoc ( $w ) ) {
|
||||
|
||||
$str = "";
|
||||
if ($r ['register_date'] < '2008-12-31' && $r ['paid'] == 0)
|
||||
continue;
|
||||
// if($r['type']!='correct'){
|
||||
$rinv = $GLOBALS ['db']->fetchByAssoc ( $GLOBALS ['db']->query ( "select description,id from ecminvoiceouts where id='" . $r ['ecminvoiceout_id'] . "'" ) );
|
||||
if ($r ['paid'] == 0) {
|
||||
$winien_roz += $r['total'];
|
||||
} else {
|
||||
$paid = "*";
|
||||
$checkbox = "";
|
||||
$color = ' color: #33FF00; ';
|
||||
$winien_n_roz += $r['total'];
|
||||
}
|
||||
$exp = explode ( "-", $r ['register_date'] );
|
||||
|
||||
if ($r ['paid'] == 0)
|
||||
$arrear += $r ['total'];
|
||||
|
||||
if ($r ['ecminvoiceout_id'])
|
||||
$inv = '<a href="index.php?module=EcmInvoiceOuts&action=DetailView&record=' . $r ['ecminvoiceout_id'] . '">' . $r ['document_no'] . '</a>';
|
||||
else
|
||||
$inv = $r ['document_no'];
|
||||
|
||||
// }
|
||||
$total_wn += $r ['total'];
|
||||
}
|
||||
$query = "select payment_date,id,description,value,paid,name from ecmpayments where deleted='0' and parent_id='" . $this->bean->id . "' order by date_entered desc";
|
||||
|
||||
$w = $GLOBALS ['db']->query ( $query );
|
||||
$last_date = "";
|
||||
|
||||
$ma_roz = 0;
|
||||
$ma_n_roz = 0;
|
||||
while ( $r = $GLOBALS ['db']->fetchByAssoc ( $w ) ) {
|
||||
$str = "";
|
||||
if ($r ['payment_date'] < '2008-12-31' && $r ['paid'] == 0)
|
||||
continue;
|
||||
if ($r ['paid']) {
|
||||
$paid = "*";
|
||||
$checkbox = "";
|
||||
$color = ' color: #33FF00;';
|
||||
$ma_roz+=$r['value'];
|
||||
} else {
|
||||
$paid = " ";
|
||||
$checkbox = '<input type="checkbox" name="check2[]" value="' . $r ['id'] . '" onclick="addValue(this,' . $r ['value'] . ',document.getElementById(\'total_ma\'));">';
|
||||
$color = ' color: #FF3333;';
|
||||
$ma_n_roz+=$r['value'];
|
||||
}
|
||||
if (str_replace ( " ", "", $r ['name'] ) == "" || ! $r ['name'])
|
||||
$r ['name'] = "blank";
|
||||
if (! $_REQUEST ['document_no'] && $last_date != $r ['payment_date'] && ($r ['paid'] == 0 || ! $wh_paid_p)) {
|
||||
if ($wh_paid_p)
|
||||
$whp = " and paid='0'";
|
||||
else
|
||||
$whp = "";
|
||||
$rr = $GLOBALS ['db']->fetchByAssoc ( $GLOBALS ['db']->query ( "select sum(value) as sum from ecmpayments where deleted='0' and parent_id='" . $_REQUEST ['lead_id'] . "'" . $whp . " and payment_date='" . $r ['payment_date'] . "'" ) );
|
||||
$sum_total = $rr ['sum'];
|
||||
}
|
||||
if ($r ['name'] == "blank")
|
||||
$desc_name = $r ['description'];
|
||||
else
|
||||
$desc_name = $r ['name'];
|
||||
$total_ma += $r ['value'];
|
||||
if ($r ['paid'] == 0 || ! $wh_paid_p)
|
||||
$last_date = $r ['payment_date'];
|
||||
if ($r ['paid'] == 0)
|
||||
$total_not_paid += $r ['value'];
|
||||
} $sumr=( $ma_n_roz - $winien_n_roz );
|
||||
$sumn=($ma_roz + $ma_n_roz) - ($winien_roz + $winien_n_roz);
|
||||
$sumn=number_format($sumn, 2, ',', ' ');
|
||||
if($sumn>0){
|
||||
$color='FF3333';
|
||||
} else {
|
||||
$color='000000';
|
||||
|
||||
}
|
||||
$sumr='<p style="color:#'.$color.';">'.number_format($sumr, 2, ',', ' ').'</p>';
|
||||
$this->ss->assign("custom_code_billing", $push_billing);
|
||||
$this->ss->assign("custom_code_shipping", $push_shipping);
|
||||
$this->ss->assign('SUMN',$sumn);
|
||||
$this->ss->assign('SUMR',$sumr);
|
||||
if(empty($this->bean->id)){
|
||||
global $app_strings;
|
||||
sugar_die($app_strings['ERROR_NO_RECORD']);
|
||||
}
|
||||
echo $this->dv->display();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
53
modules/Leads/views/view.edit.php
Normal file
53
modules/Leads/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 LeadsViewEdit extends ViewEdit
|
||||
{
|
||||
public function preDisplay() {
|
||||
require_once('modules/Leads/EditView.php');
|
||||
parent::preDisplay();
|
||||
}
|
||||
|
||||
public function display()
|
||||
{
|
||||
parent::display();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user