Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

View File

@@ -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 - 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".
*/
global $app_strings;
$dashletMeta['MyEcmTransactionsDashlet'] = array('module' => 'EcmTransactions',
'title' => 'Wychodzące płatności',
'description' => 'A customizable view into InvoiceOuts',
'category' => 'Module Views');
?>

View File

@@ -0,0 +1,134 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* Skeleton Task Dashlet
*
* Author: Blake Robertson
* Date: December 15th, 2010
*
* How to use this file...
* - Change anywhere the text skeleton (two occurances class name and constructor name)
* - Change anywhere CHANGEME appears to the appropriate values.
* - Customize the where
*
********************************************************************************/
require_once('include/Dashlets/DashletGeneric.php');
global $sumaw;
class MyEcmTransactionsDashlet extends DashletGeneric {
function process() {
global $current_language, $app_list_strings, $image_path, $current_user;
// NOTE: date_*_flag = 1 when the date is NULL which is the opposite you'd think...
// DATES Past Start Date
// 'custom_where' => ' AND ((Date(tasks.date_start) <= Date(Now())) OR (tasks.date_start_flag=1)))',
// OVERDUE TASKS
// 'custom_where' => ' AND ((Date(tasks.date_start) <= Date(Now()) AND (tasks.date_due_flag=1)) OR (Date(tasks.date_due) <= Date(Now())) )',
// Tasks assigned to me by other people!
// Other changes, show the column "Created By" instead of Start Date.
// 'custom_where' => ' AND tasks.created_by != "' . $current_user->id . '"',
// Tasks I created for other people.
// Other changes, show the column assigned_to instead of start date., uncheck the "My Items" by default
// 'custom_where' => ' AND tasks.created_by = "' . $current_user->id . '" AND tasks.assigned_user_id != "' . $current_user->id . '"',
$lvsParams = array(
'custom_select' => '',
'custom_from' => '',
'custom_where' => ' and ecmtransactions.settled=0 and ecmtransactions.type3=1 ',
'distinct' => true
);
$dane=parent::process($lvsParams);
$sumaw=0;
for($i=0;$i<count($dane['data']);$i++){
$sumaw+=$dane['data'][$i]['VALUE'];
}
// echo $sumaw;
$this->sumap='<table style="width:276px;"><tr><td style="width:106px;">Suma:</td><td style="width:170px;text-align:right;"><b>'.number_format($sumaw,2,",",".").'</b></td></tr></table>';
$lvsParams['overrideOrder'] = true;
$lvsParams['orderBy'] = 'payment_date';
//$lvsParams['sortOrder'] = 'ASC';
$dane=parent::process($lvsParams);
}
function MyEcmTransactionsDashlet($id, $def = null) {
$this->sumap='Suma: '.$sumaw;
///echo $sum.'aa';
global $current_user, $app_strings;
// require_once('MyEcmTransactionsDashletOptions.tpl');
// Uncomment line below if you don't want dashlet restricted to items you own
// $def = array( 'myItemsOnly' => false );
$def['extabutton']=1;
parent::DashletGeneric($id, $def);
//echo $id;
if(empty($def['title'])) $this->title = 'Wychodzące płatności';
// This is the filter criteria, it's usually in a .data.php file, i moved it here so i'd have less files to modify.
$this->searchFields = array('name' => array('default' => ''),
// 'priority' => array('default' => ''),
'type' => array('default' => array('1', '0')),
'payment_date' => array('default' => ''),
'status' => array('default' => ''),
// 'team_id' => array('default' => '', 'label' => 'LBL_TEAMS'),
'assigned_user_id' => array('type' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO' )
);
// 'default' => $current_user->name
if(empty($def['filters'])){
if(isset($this->searchFields['status'])){
if(!empty($this->searchFields['status']['default'])){
$this->filters['status'] = $this->searchFields['status']['default'];
}
}
}
// This is the columns that show up in the list view, customize accordinly.
$this->columns = array(
'name' => array('width' => '8',
'label' => 'LBL_SUBJECT',
'link' => true,
'default' => true),
'value' => array('width' => '8',
'label' => 'Kwota',
'align'=>'right',
'default' => true),
'parent_id'=>array(
'width'=>0,
'label'=>'&nbsp;',
'customCode'=>'&nbsp;',
'default'=>true,
'sortable'=>false,
),
'parent_name' => array(
'width' => '20',
'label' => 'Konrahent',
'default' => true,
'id'=>'parent_id',
'module'=>'Accounts',
'link'=>true),
'payment_date' => array('width' => '8',
'label' => 'Termin płatności',
'default' => true),
'options' => array('width' => '2',
'label' => 'Opcje',
'default' => true),
);
$this->seedBean = new EcmTransaction();
$this->lvs->quickViewLinks = false;
}
}
?>

View File

@@ -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 - 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".
*/
global $app_strings;
$dashletMeta['MyEcmTransactionsDashlet2'] = array('module' => 'EcmTransactions',
'title' => 'Przychodzące płatności',
'description' => 'A customizable view into InvoiceOuts',
'category' => 'Module Views');
?>

View File

@@ -0,0 +1,135 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* Skeleton Task Dashlet
*
* Author: Blake Robertson
* Date: December 15th, 2010
*
* How to use this file...
* - Change anywhere the text skeleton (two occurances class name and constructor name)
* - Change anywhere CHANGEME appears to the appropriate values.
* - Customize the where
*
********************************************************************************/
require_once('include/Dashlets/DashletGeneric.php');
global $sumaw;
class MyEcmTransactionsDashlet2 extends DashletGeneric {
function process() {
global $current_language, $app_list_strings, $image_path, $current_user;
// NOTE: date_*_flag = 1 when the date is NULL which is the opposite you'd think...
// DATES Past Start Date
// 'custom_where' => ' AND ((Date(tasks.date_start) <= Date(Now())) OR (tasks.date_start_flag=1)))',
// OVERDUE TASKS
// 'custom_where' => ' AND ((Date(tasks.date_start) <= Date(Now()) AND (tasks.date_due_flag=1)) OR (Date(tasks.date_due) <= Date(Now())) )',
// Tasks assigned to me by other people!
// Other changes, show the column "Created By" instead of Start Date.
// 'custom_where' => ' AND tasks.created_by != "' . $current_user->id . '"',
// Tasks I created for other people.
// Other changes, show the column assigned_to instead of start date., uncheck the "My Items" by default
// 'custom_where' => ' AND tasks.created_by = "' . $current_user->id . '" AND tasks.assigned_user_id != "' . $current_user->id . '"',
$date = new DateTime(date('Y-m-d', time()));
$d=$date->format('Y-m-d');
$date->modify('+5 days');
$d2=$date->format('Y-m-d');
$lvsParams = array(
'custom_select' => '',
'custom_from' => ' inner join accounts aa on aa.id=ecmtransactions.parent_id',
'custom_where' => ' and ecmtransactions.settled=0 and aa.account_type="rec"',
'distinct' => true
);
$dane=parent::process($lvsParams);
$sumaw=0;
for($i=0;$i<count($dane['data']);$i++){
$sumaw+=$dane['data'][$i]['VALUE'];
}
$this->sumap='<table style="width:276px;"><tr><td style="width:106px;">Suma:</td><td style="width:170px;text-align:right;"><b>'.number_format($sumaw,2,",",".").'</b></td></tr></table>';
$lvsParams['overrideOrder'] = true;
$lvsParams['orderBy'] = 'payment_date';
$lvsParams['sortOrder'] = 'ASC';
$dane=parent::process($lvsParams);
}
function MyEcmTransactionsDashlet2($id, $def = null) {
//$this->sumap='Suma: '.$sumaw;
//echo $sum;
global $current_user, $app_strings;
// require_once('MyEcmTransactionsDashlet2Options.tpl');
// Uncomment line below if you don't want dashlet restricted to items you own
// $def = array( 'myItemsOnly' => false );
parent::DashletGeneric($id, $def);
if(empty($def['title'])) $this->title = 'Przychodzące płatności';
// This is the filter criteria, it's usually in a .data.php file, i moved it here so i'd have less files to modify.
$this->searchFields = array('name' => array('default' => ''),
// 'priority' => array('default' => ''),
'type' => array('default' => array('1', '0')),
'payment_date' => array('default' => ''),
'status' => array('default' => ''),
// 'team_id' => array('default' => '', 'label' => 'LBL_TEAMS'),
'assigned_user_id' => array('type' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO' )
);
// 'default' => $current_user->name
if(empty($def['filters'])){
if(isset($this->searchFields['status'])){
if(!empty($this->searchFields['status']['default'])){
$this->filters['status'] = $this->searchFields['status']['default'];
}
}
}
// This is the columns that show up in the list view, customize accordinly.
$this->columns = array(
'name' => array('width' => '8',
'label' => 'LBL_SUBJECT',
'link' => true,
'default' => true),
'value' => array('width' => '8',
'label' => 'Kwota',
'align'=>'right',
'default' => true),
'parent_id'=>array(
'width'=>0,
'label'=>'&nbsp;',
'customCode'=>'&nbsp;',
'default'=>true,
'sortable'=>false,
),
'parent_name' => array(
'width' => '20',
'label' => 'Konrahent',
'default' => true,
'id'=>'parent_id',
'module'=>'Accounts',
'link'=>true),
'payment_date' => array('width' => '8',
'label' => 'Termin płatności',
'default' => true),
'options' => array('width' => '2',
'label' => 'Opcje',
'default' => true),
);
$this->seedBean = new EcmTransaction();
$this->lvs->quickViewLinks = false;
}
}
?>