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,52 @@
<?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): ______________________________________..
********************************************************************************/
global $app_strings;
$dashletMeta['EcmWorkCardsDashlet'] = array('module' => 'EcmWorkCards',
'title' => translate('LBL_HOMEPAGE_TITLE', 'EcmWorkCards'),
'description' => 'A customizable view into EcmWorkCards',
'icon' => 'icon_EcmWorkCards_32.gif',
'category' => 'Module Views');

View File

@@ -0,0 +1,63 @@
<?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): ______________________________________..
********************************************************************************/
require_once('include/Dashlets/DashletGeneric.php');
require_once('modules/EcmWorkCards/EcmWorkCard.php');
class EcmWorkCardsDashlet extends DashletGeneric {
function EcmWorkCardsDashlet($id, $def = null) {
global $current_user, $app_strings;
require('modules/EcmWorkCards/metadata/dashletviewdefs.php');
parent::DashletGeneric($id, $def);
if(empty($def['title'])) $this->title = translate('LBL_HOMEPAGE_TITLE', 'EcmWorkCards');
$this->searchFields = $dashletData['EcmWorkCardsDashlet']['searchFields'];
$this->columns = $dashletData['EcmWorkCardsDashlet']['columns'];
$this->seedBean = new EcmWorkCard();
}
}

View File

@@ -0,0 +1,44 @@
<?php
if (!defined('sugarEntry') || !sugarEntry)
die('Not A Valid Entry Point');
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user, $app_list_strings;
require_once ('include/time.php');
require_once('include/json_config.php');
$json_config = new json_config();
$focus = new EcmWorkCard();
if (isset($_REQUEST['record']))
$focus->retrieve($_REQUEST['record']);
require_once('include/MVC/View/SugarView.php');
if (file_exists('modules/EcmWorkCards/view/DetailView/view.detail.my.php')) {
require_once('modules/EcmWorkCards/view/DetailView/view.detail.my.php');
$detail = new ViewDetailMy();
$detail->ss = new Sugar_Smarty();
$detail->module = 'EcmWorkCards';
} else {
require_once('include/MVC/View/views/view.detail.php');
$detail = new ViewDetail();
$detail->ss = new Sugar_Smarty();
$detail->module = 'EcmWorkCards';
}
global $app_list_strings;
$eal = $focus->getActionList();
$detail->ss->assign('TABLEECMACTIONS_LIST', $eal);
$detail->bean = $focus;
$detail->preDisplay();
unset($detail->defs['templateMeta']['form']['buttons'][2]);
echo $detail->display();
require_once ('include/SubPanel/SubPanelTiles.php');
$subpanel = new SubPanelTiles ( $focus, 'EcmWorkCards' );
echo $subpanel->display ();
?>

View File

@@ -0,0 +1,213 @@
<?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".
* ******************************************************************************
*/
/**
* THIS CLASS IS GENERATED BY MODULE BUILDER
* PLEASE DO NOT CHANGE THIS CLASS
* PLACE ANY CUSTOMIZATIONS IN EcmWorkCard
*/
class EcmWorkCard extends Basic {
var $new_schema = true;
var $module_dir = 'EcmWorkCards';
var $object_name = 'EcmWorkCard';
var $table_name = 'ecmworkcards';
var $importable = false;
var $disable_row_level_security = true; // to ensure that modules created and deployed under CE will continue to function under team security if the instance is upgraded to PRO
var $id;
var $name;
var $date_entered;
var $date_modified;
var $modified_user_id;
var $modified_by_name;
var $created_by;
var $created_by_name;
var $description;
var $deleted;
var $created_by_link;
var $modified_user_link;
var $assigned_user_id;
var $assigned_user_name;
var $assigned_user_link;
var $date;
var $work_name;
function EcmWorkCard() {
parent::Basic();
}
function bean_implements($interface) {
switch ($interface) {
case 'ACL' :
return true;
}
return false;
}
function save($check_notify = false) {
$this->name = $this->date . " " . $this->worker_name;
parent::save($check_notify);
$actionList = json_decode(base64_decode($_POST ['tableEcmActions_list']));
$action_array = array();
$i = 0;
foreach ($actionList as $value) {
if ($value->ecmproductid!= '') {
if($value->quantity != '0') {
$action_array [$i] ['ecmproductid'] = $value->ecmproductid;
$action_array [$i] ['ecmaction'] = $value->ecmaction;
$action_array [$i] ['quantity'] = $value->quantity;
$action_array [$i] ['ecmactioncost'] = $value->ecmactioncost;
$action_array [$i] ['costbrutto'] = $value->costbrutto;
$i = $i+1;
}
}
}
$this->saveActionList($action_array);
}
function create_new_list_query($order_by, $where, $parentbean, $filter = array(), $params = array(), $show_deleted = 0, $join_type = '', $return_array = false, $singleSelect = false){
global $current_user;
$ret_array = parent::create_new_list_query($order_by, $where,$filter,$params, $show_deleted,$join_type, $return_array,$parentbean, $singleSelect);
// filtrowanie po dacie od do
// filtrowanie po dacie od do
$ret_array['where'] = str_replace("ecmworkcards.date_start =", "ecmworkcards.date > ", $ret_array['where']);
$ret_array['where'] = str_replace("ecmworkcards.date_end =", "ecmworkcards.date < ", $ret_array['where']);
return $ret_array;
}
function get_list_view_data() {
$array = parent::get_list_view_data();
$this->retrieve($this->id);
$array['DATE'] = $this->date;
$array['WORKER_NAME']='<a href="index.php?module=EcmWorkers&action=DetailView&record='.$this->worker_id.'">'.$this->worker_name.'</a>';
return $array;
}
function saveActionList($pl) {
global $current_user;
$exists = array();
if ($this->id != '') {
$GLOBALS ['db']->query("DELETE FROM ecmworkcards_ecmaction WHERE ecmworkcards='" . $this->id . "'");
}
foreach ($pl as $p) {
// insert new record
$id = create_guid();
$t = array(
$id,
$this->id,
$current_user->id,
$this->date_modified,
addslashes($p ['ecmproductid']),
addslashes($p ['ecmaction']),
addslashes($p ['quantity']),
addslashes($p ['ecmactioncost']),
addslashes($p ['costbrutto']),
);
$q = "INSERT INTO ecmworkcards_ecmaction VALUES ('" . implode("','", $t) . "')";
$GLOBALS ['db']->query($q);
$exists [] = $id;
}
}
function getActionList($array = false) {
if (isset($this->id) && $this->id != '') {
$query = "SELECT
a.ecmproduct AS ecmproductid,
a.ecmaction AS ecmaction,
a.quantity AS quantity,
b.code AS code,
b.name AS ecmproductname,
c.name AS ecmaction_name,
c.indeks AS ecmaction_indeks,
a.ecmactioncost AS ecmactioncost,
a.costbrutto AS costbrutto,
IFNULL(a.ecmactioncost*a.quantity,'0,00') AS ecmactioncost_display,
IFNULL(a.costbrutto*a.quantity,'0,00') AS costbrutto_display
FROM
ecmworkcards_ecmaction a
INNER JOIN
ecmproducts b ON b.id = a.ecmproduct
LEFT JOIN
ecmactions c ON c.id = a.ecmaction
WHERE
a.ecmproduct = b.id
AND a.ecmworkcards ='" . $this->id . "' ORDER BY b.code";
$r = $this->db->query($query);
$return_array = array();
if ($r) {
while ($row = $this->db->fetchByAssoc($r)) {
$a_json_row ['ecmproductid'] = $row ['ecmproductid'];
$a_json_row ['ecmaction'] = $row ['ecmaction'];
$a_json_row ['ecmaction_name'] = $row ['ecmaction_name'];
$a_json_row ['ecmaction_indeks'] = $row ['ecmaction_indeks'];
$a_json_row ['quantity'] = $row ['quantity'];
$a_json_row ['code'] = $row ['code'];
$a_json_row ['ecmactioncost_display'] = format_number($row ['ecmactioncost_display']);
$a_json_row ['ecmactioncost'] = $row ['ecmactioncost'];
$a_json_row ['ecmproductname'] = $row ['ecmproductname'];
$a_json_row ['costbrutto_display'] = format_number($row ['costbrutto_display']);
$a_json_row ['costbrutto'] = $row ['costbrutto'];
$a_json_row ['ecmactioncost_single_netto'] = format_number($row ['ecmactioncost']);
$a_json_row ['ecmactioncost_single_brutto'] = format_number($row ['costbrutto']);
$a_json_row ['produkt'] = array();
$a_json_row ['produkt'][0] = $row ['code'];
$a_json_row ['produkt'][1] =$row ['ecmproductname'];
$a_json_row ['produkt'][2] = $row ['ecmproductid'];
$a_json_row ['czynnosc'] = array();
$a_json_row ['czynnosc'][0] = $row ['ecmaction_indeks'];
$a_json_row ['czynnosc'][1] =$row ['ecmaction_name'];
$a_json_row ['czynnosc'][2] = $row ['ecmaction'];
$a_json_row ['netto'] = array();
$a_json_row ['netto'][0] = format_number($row ['ecmactioncost']);
$a_json_row ['netto'][1] =format_number($row ['ecmactioncost_display']);
$a_json_row ['brutto'] = array();
$a_json_row ['brutto'][0] = format_number($row ['costbrutto']);
$a_json_row ['brutto'][1] = format_number($row ['costbrutto_display']);
$return_array [] = $a_json_row;
}
return $array ? base64_encode(json_encode($return_array)) : base64_encode(json_encode($return_array));
}
}
return $array ? false : '[]';
}
}
?>

View File

@@ -0,0 +1,35 @@
<?php
if (!defined('sugarEntry') || !sugarEntry)
die('Not A Valid Entry Point');
global $sugar_version, $sugar_config, $current_user, $app_strings, $mod_strings, $current_user;
require_once ('include/time.php');
require_once('include/json_config.php');
$json_config = new json_config();
$focus = new EcmWorkCard();
if (isset($_REQUEST['record']) && $_REQUEST['record'] != '') {
$focus->retrieve($_REQUEST['record']);
$focus->format_all_fields();
}else{
$focus->date = date("d.m.Y");
}
require_once('include/MVC/View/SugarView.php');
require_once('modules/EcmWorkCards/view/EditView/view.edit.my.php');
$edit = new ViewEditEcmWorkCards();
$edit->ss = new Sugar_Smarty();
$edit->tplFile = 'include/ECM/EcmViews/EditView/Tabs/EditView.tpl';
$edit->module = 'EcmWorkCards';
$edit->bean = $focus;
$eal = $focus->getActionList();
$edit->ss->assign('TABLEECMACTIONS_LIST', $eal);
$edit->preDisplay();
echo $edit->display();
?>

43
modules/EcmWorkCards/Menu.php Executable file
View File

@@ -0,0 +1,43 @@
<?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 $mod_strings, $app_strings, $sugar_config;
if(ACLController::checkAccess('EcmWorkCards', 'edit', true))$module_menu[]=Array("index.php?module=EcmWorkCards&action=EditView&return_module=EcmWorkCards&return_action=DetailView", $mod_strings['LNK_NEW_RECORD'],"CreateEcmWorkCard", 'EcmWorkCard');
if(ACLController::checkAccess('EcmWorkCards', 'list', true))$module_menu[]=Array("index.php?module=EcmWorkCards&action=index&return_module=EcmWorkCards&return_action=DetailView", $mod_strings['LNK_LIST'],"EcmWorkCard", 'EcmWorkCard');
if(ACLController::checkAccess('EcmWorkCards', 'list', true))$module_menu[]=Array("index.php?module=EcmReports&action=ReportEcmWorkCards&return_module=EcmWorkCards&return_action=DetailView", $mod_strings['LNK_REPORT_WORKCARDS_WORKERS'],"EcmWorkCard", 'EcmWorkCard');
if(ACLController::checkAccess('EcmWorkCards', 'list', true))$module_menu[]=Array("index.php?module=EcmReports&action=ReportEcmWorkCardsEcmProduct&return_module=EcmWorkCards&return_action=DetailView", $mod_strings['LNK_REPORT_WORKCARDS_PRODUCTS'],"EcmWorkCard", 'EcmWorkCard');

143
modules/EcmWorkCards/dbpost.php Executable file
View File

@@ -0,0 +1,143 @@
<?php
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
die ( '-1' );
if (! $_POST ['job'] || $_POST ['job'] == '')
die ( '-1' );
switch ($_POST ['job']) {
case 'getWorkerName' :
getWorkerName ( $_POST ['worker'] );
break;
case 'ecmProductNameAutocomplite':
ecmProductNameAutocomplite($_POST['name']);
break;
case 'ecmProductIndeksAutocomplite':
ecmProductIndeksAutocomplite($_POST['indeks']);
break;
case 'getProductActions':
getProductActions($_POST['id']);
break;
case 'getProductActionsLoad':
getProductActionsLoad($_POST['id']);
break;
case 'getEcmActionsCost':
getEcmActionsCost($_POST['id']);
break;
}
function ecmProductNameAutocomplite($name) {
$db = $GLOBALS ['db'];
$result = array();
$nazwa = '';
if ($name != '') {
$nazwa = ' AND UPPER(name) LIKE "%' . $name . '%" ';
}
$q = 'SELECT id, name, code FROM ecmproducts WHERE deleted=0 ' . $nazwa . ' ORDER BY name LIMIT 0,50';
$rs = $db->query($q);
if ($rs->num_rows > 0) {
while ($row = $db->fetchByAssoc($rs)) {
$a_json_row ['id'] = $row ['id'];
$a_json_row ['ecmproductname'] = $row ['name'];
$a_json_row ['code'] = $row ['code'];
$a_json_row ['label'] = "</span>Indeks: <span style='color: blue;'>" . $row ['code'] . "</span><br>Nazwa: <span style='color: blue;'>" . $row ['name'] . '</span>';
$a_json_row ['value'] = $row ['name'];
$result [] = $a_json_row;
}
} else {
$a_json_row ['id'] = '';
$a_json_row ['ecmproductname'] = '';
$a_json_row ['code'] = '';
$a_json_row ["label"] = "<span style='color: red;'>Brak produktu o szukanej nazwie</span>";
$a_json_row ['value'] = '';
$result [] = $a_json_row;
}
$json = json_encode($result);
print $json;
}
function ecmProductIndeksAutocomplite($indeks){
$db = $GLOBALS ['db'];
$result = array();
$nazwa = '';
if ($indeks != '') {
$nazwa = ' AND UPPER(code) LIKE "%' . $indeks . '%" ';
}
$q = 'SELECT id, name, code FROM ecmproducts WHERE deleted=0 ' . $nazwa . ' ORDER BY name LIMIT 0,50';
$rs = $db->query($q);
if ($rs->num_rows > 0) {
while ($row = $db->fetchByAssoc($rs)) {
$a_json_row ['id'] = $row ['id'];
$a_json_row ['ecmproductname'] = $row ['name'];
$a_json_row ['code'] = $row ['code'];
$a_json_row ['label'] = "</span>Indeks: <span style='color: blue;'>" . $row ['code'] . "</span><br>Nazwa: <span style='color: blue;'>" . $row ['name'] . '</span>';
$a_json_row ['value'] = $row ['code'];
$result [] = $a_json_row;
}
} else {
$a_json_row ['id'] = '';
$a_json_row ['ecmproductname'] = '';
$a_json_row ['code'] = '';
$a_json_row ["label"] = "<span style='color: red;'>Brak produktu o szukanym indeksie</span>";
$a_json_row ['value'] = '';
$result [] = $a_json_row;
}
$json = json_encode($result);
print $json;
}
function getProductActionsLoad($id){
$db = $GLOBALS ['db'];
$result = array();
$q = 'SELECT CONCAT(a.indeks, " ", a.name) as name, a.id as id FROM ecmproductactions pa, ecmactions a, ecmworkcards_ecmaction wa WHERE pa.ecmproduct_id="' . $id . '" AND pa.ecmaction_id = a.id ORDER BY pa.position DESC';
$rs = $db->query($q);
if ($rs->num_rows > 0) {
while ($row = $db->fetchByAssoc($rs)) {
$a_json_row ['id'] = $row ['id'];
$a_json_row ['name'] = $row ['name'];
$result [] = $a_json_row;
}
}
$json = json_encode($result);
//$json = json_encode($q);
print $json;
}
function getProductActions($id){
$db = $GLOBALS ['db'];
$result = array();
$q = 'SELECT CONCAT(a.indeks, " ", a.name) as name, a.id as id, a.cost_other as ecmactioncost, a.cost_action as costbrutto FROM ecmproductactions pa, ecmactions a WHERE a.deleted=0 AND pa.ecmproduct_id="' . $id . '" AND pa.ecmaction_id = a.id ORDER BY pa.position DESC';
$rs = $db->query($q);
if ($rs->num_rows > 0) {
while ($row = $db->fetchByAssoc($rs)) {
$a_json_row ['id'] = $row ['id'];
$a_json_row ['name'] = $row ['name'];
$a_json_row ['ecmactioncost'] = $row ['ecmactioncost'];
$a_json_row ['costbrutto'] = $row ['costbrutto'];
$result [] = $a_json_row;
}
}
$json = json_encode($result);
// $json = json_encode($q);
print $json;
}
function getEcmActionsCost($id){
$db = $GLOBALS ['db'];
$q = 'SELECT cost_other, cost_action FROM ecmactions WHERE id="' . $id . '"';
$rs = $db->query($q);
if ($rs->num_rows > 0) {
$row = $db->fetchByAssoc($rs);
$a_json_row['cost_other'] = $row ['cost_other'];
$a_json_row['cost_action'] = $row ['cost_action'];
}
$json = json_encode($a_json_row);
print $json;
}
?>

View File

@@ -0,0 +1,75 @@
<?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".
********************************************************************************/
$mod_strings = array (
'LBL_ASSIGNED_TO_ID' => 'Assigned User Id',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to',
'LBL_ID' => 'ID',
'LBL_DATE_ENTERED' => 'Date Created',
'LBL_DATE_MODIFIED' => 'Date Modified',
'LBL_MODIFIED' => 'Modified By',
'LBL_MODIFIED_ID' => 'Modified By Id',
'LBL_MODIFIED_NAME' => 'Modified By Name',
'LBL_CREATED' => 'Created By',
'LBL_CREATED_ID' => 'Created By Id',
'LBL_DESCRIPTION' => 'Description',
'LBL_DELETED' => 'Deleted',
'LBL_NAME' => 'Nazwa',
'LBL_CREATED_USER' => 'Created by User',
'LBL_MODIFIED_USER' => 'Modified by User',
'LBL_LIST_NAME' => 'Name',
'LBL_EDIT_BUTTON' => 'Edit',
'LBL_REMOVE' => 'Remove',
'LBL_LIST_FORM_TITLE' => 'EcmWorkCards List',
'LBL_MODULE_NAME' => 'EcmWorkCards',
'LBL_MODULE_TITLE' => 'EcmWorkCards',
'LBL_HOMEPAGE_TITLE' => 'My EcmWorkCards',
'LNK_NEW_RECORD' => 'Create EcmWorkCards',
'LNK_LIST' => 'View EcmWorkCards',
'LNK_IMPORT_TMP_ACTIONS' => 'Import EcmWorkCards',
'LBL_SEARCH_FORM_TITLE' => 'Search EcmWorkCards',
'LBL_HISTORY_SUBPANEL_TITLE' => 'View History',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
'LBL_TMP_ACTIONS_SUBPANEL_TITLE' => 'EcmWorkCards',
'LBL_NEW_FORM_TITLE' => 'New EcmWorkCards',
'LBL_WORKER' => 'Worker',
'LBL_TIME' => 'Norma',
'LBL_UNIT_MEASURE' => 'Jednostka miary',
'LBL_COST_ACTION' => 'Cena1',
'LBL_COST_HOUR' => 'Cena 2',
'LBL_COST_OTHER' => 'Cena3',
'LBL_EDITVIEW_PANEL1' => 'Inne',
);

View File

@@ -0,0 +1,81 @@
<?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".
********************************************************************************/
$mod_strings = array (
'LBL_ACTIONS' => 'Czynności',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
'LBL_ASSIGNED_TO_ID' => 'Przypisano do Id',
'LBL_ASSIGNED_TO_NAME' => 'Przypisano do',
'LBL_CATEGORY' => 'Kategoria',
'LBL_CREATED' => 'Utworzone przez',
'LBL_CREATED_ID' => 'Utworzone przez Id',
'LBL_CREATED_USER' => 'Utworzone przez',
'LBL_DATE' => 'Data',
'LBL_DATE_ENTERED' => 'Data utworzenia',
'LBL_DATE_MODIFIED' => 'Data modyfikacji',
'LBL_DELETED' => 'Usunięte',
'LBL_DESCRIPTION' => 'Opis',
'LBL_EDITVIEW_PANEL1' => 'Inne',
'LBL_EDIT_BUTTON' => 'Edytuj',
'LBL_HISTORY_SUBPANEL_TITLE' => 'Zobacz historie',
'LBL_HOMEPAGE_TITLE' => 'Moje karty pracy',
'LBL_ID' => 'ID',
'LBL_ITEMS_TAB' => 'Szczegóły',
'LBL_LIST_FORM_TITLE' => 'Lista kart pracy',
'LBL_LIST_NAME' => 'Nazwa',
'LBL_MODIFIED' => 'Modyfikowano przez',
'LBL_MODIFIED_ID' => 'Modyfikowano przez Id',
'LBL_MODIFIED_NAME' => 'Modyfikowano przez',
'LBL_MODIFIED_USER' => 'Modyfikowane przez',
'LBL_MODULE_NAME' => 'Karty pracy',
'LBL_MODULE_TITLE' => 'Karty pracy',
'LBL_NAME' => 'Nazwa',
'LBL_NEW_FORM_TITLE' => 'Nowa karta pracy',
'LBL_REMOVE' => 'Usuń',
'LBL_SEARCH_FORM_TITLE' => 'Szukaj kart pracy',
'LBL_TMP_ACTIONS_SUBPANEL_TITLE' => 'Karty Pracy',
'LBL_WORKER_NAME' => 'Pracownik',
'LNK_IMPORT_TMP_ACTIONS' => 'Importuj karty pracy',
'LNK_LIST' => 'Lista kart pracy',
'LNK_NEW_RECORD' => 'Utwórz kartę pracy',
'LBL_ITEMS' => ' ',
'LBL_NOTES_SUBPANEL_TITLE' => 'Notatki',
'LBL_NOTES' => 'Notatki',
'LBL_WORKCARD_NAME' => 'Karta pracy',
'LBL_DATE_START' => 'Data od',
'LBL_DATE_END' => 'Data do',
'LNK_REPORT_WORKCARDS_WORKERS' => 'Raport kart pracy - Pracownicy',
'LNK_REPORT_WORKCARDS_PRODUCTS' => 'Raport kart pracy - Produkty',
);

View 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".
********************************************************************************/
$module_name = 'EcmWorkCards';
$searchFields[$module_name] =
array (
'name' => 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
);
?>

View File

@@ -0,0 +1,65 @@
<?php
$module_name = 'EcmWorkCards';
$viewdefs [$module_name] = array(
'DetailView' => array(
'templateMeta' => array(
'form' => array(
'buttons' => array(
0 => 'EDIT',
//1 => 'DUPLICATE',
1 => 'DELETE',
array(
'customCode' => '<input title="{$APP.LBL_DUPLICATE_BUTTON_TITLE}" accessKey="{$APP.LBL_DUPLICATE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value=\'EcmWorkCards\'; this.form.return_action.value=\'DetailView\'; this.form.isDuplicate.value=true; this.form.action.value=\'EditView\'; this.form.return_id.value=\'{$id}\';" type="submit" name="Duplicate" value="{$APP.LBL_DUPLICATE_BUTTON_LABEL}" id="duplicate_button">'
),
// 3 => 'FIND_DUPLICATES'
),
),
'maxColumns' => '2',
'widths' => array(
0 => array(
'label' => '5',
'field' => '30'
),
1 => array(
'label' => '5',
'field' => '30'
)
),
'includes' => array(
0 => array(
'file' => 'modules/EcmWorkCards/js/DetailViewDocumentReady.js'
)
)
),
'panels' => array(
'LBL_ITEMS_TAB' => array(
array(
array(
'name' => 'worker_name',
'label' => 'LBL_WORKER_NAME',
)
),
array(
array(
'name' => 'date',
'label' => 'LBL_DATE',
)
),
array(
'description'
),
),
'LBL_ACTIONS' => array(
array(
array(
'allCols' => true,
'hideLabel' => true,
'customCode' => "{include file='modules/EcmWorkCards/tpl/DetailViewTableEcmActions.tpl'}",
),
),
),
),
)
);
?>

View File

@@ -0,0 +1,99 @@
<?php
$viewdefs ['EcmWorkCards'] ['EditView'] = array(
'templateMeta' => array(
'form' => array(
'enctype' => 'multipart/form-data',
'hidden' => array(
'<input type="hidden" name="isSaveAndNew" value="false">'),
'buttons' => array(
'SAVE',
'CANCEL',
// array(
// 'customCode' => '<input '
// . 'title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" '
// . 'accessKey="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_KEY}" '
// . 'class="button" '
// . 'onclick=" this.form.action.value=\'Save\'; this.form.return_module.value=\'EcmWorkCards\'; this.form.return_action.value=\'DetailView\'; this.form.isDuplicate.value=true; this.form.action.value=\'EditView\'; this.form.return_id.value=\'{$id}\';" '
// . 'type="submit" '
// . 'name="SaveAndDuplicate" '
// . 'value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}" '
// . 'id="SaveAndDuplicate">'
// ),
),
),
'maxColumns' => '2',
'widths' => array(
array(
'label' => '10',
'field' => '30'
),
array(
'label' => '10',
'field' => '30'
)
),
'javascript' => '
<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/jsolait/init.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/jsolait/lib/urllib.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/jsclass_base.js"></script>
<script type="text/javascript" src="include/javascript/jsclass_async.js"></script>
<script type="text/javascript" src="include/JSON.js?s={$SUGAR_VERSION}"></script>
<script type="text/javascript" src="modules/EcmWorkCards/js/EditViewDocumentReady.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>',
'includes' => array(
array(
'file' => 'include/JSON.js'
),
),
),
'panels' => array(
'LBL_ITEMS_TAB' => array(
array(
array(
'type' => 'tab',
'active' => true
),
),
array(
array(
'name' => 'worker_name',
'label' => 'LBL_WORKER_NAME',
'tabindex' => '101',
'displayParams' => array(
'size' => 50
),
),
),
array(
array(
'name' => 'date',
'label' => 'LBL_DATE',
'tabIndex' => '102',
),
),
array(
array(
'label' => 'LBL_DESCRIPTION',
'name' => 'description',
'displayParams' => array('rows' => 2, 'cols' => 60),
),
),
),
'LBL_ACTIONS' => array(
array(
array(
'type' => 'tab',
),
),
array(
array(
'allCols' => true,
'hideLabel' => true,
'customCode' => "{include file='modules/EcmWorkCards/tpl/EditViewTableEcmActions.tpl'}",
),
),
),
),
);
?>

View File

@@ -0,0 +1,22 @@
<?php
//echo '<script type="text/javascript" src="modules/EcmWorkCards/ListViewDocumentReady.js"></script>';
$module_name = 'EcmWorkCards';
$listViewDefs [$module_name] = array (
'DATE' => array (
'type' => 'datetime',
'label' => 'LBL_DATE',
'link' => 'true',
'width' => '5%',
'default' => true,
'align' => 'right',
),
'WORKER_NAME' => array (
'type' => 'varchar',
'label' => 'LBL_WORKER_NAME',
'link' => 'false',
'width' => '70%',
'default' => true,
'align' => 'left',
),
);
?>

View File

@@ -0,0 +1,67 @@
<?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".
* ****************************************************************************** */
$module_name = 'EcmWorkCards';
$object_name = 'EcmWorkCard';
$_module_name = 'ecmworkcards';
$popupMeta = array(
'moduleMain' => $module_name,
'varName' => $object_name,
'orderBy' => $_module_name . '.date, ' . $_module_name . '.worker_name',
'whereClauses' =>array(
'date' => $_module_name . '.date',
'worker_name' => $_module_name . '.worker_name',
),
'searchInputs' =>array(
'date',
'worker_name'
),
'searchdefs' => array(
'date',
'worker_name',
),
'listviewdefs' => array(
'NAME' => array(
'width' => '40',
'label' => 'LBL_WORKCARD_NAME',
'link' => true,
'default' => true,
),
),
);
?>

View File

@@ -0,0 +1,56 @@
<?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".
* ****************************************************************************** */
$module_name = 'EcmWorkCards';
$viewdefs[$module_name]['QuickCreate'] = array(
'templateMeta' => array('maxColumns' => '2',
'widths' => array(
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30')
),
),
'panels' => array(
'default' =>
array(
array(
'name',
'assigned_user_name',
),
),
),
);
?>

View File

@@ -0,0 +1,38 @@
<?php
$module_name = 'EcmWorkCards';
$searchdefs [$module_name] = array(
'layout' => array(
'basic_search' => array(
'worker_name' => array(
'type' => 'varchar',
'label' => 'LBL_WORKER_NAME',
'width' => '10%',
'default' => true,
'name' => 'worker_name'
),
'date_start',
'date_end',
),
'advanced_search' => array (
'worker_name' => array(
'type' => 'varchar',
'label' => 'LBL_WORKER_NAME',
'width' => '10%',
'default' => true,
'name' => 'worker_name'
),
'date_start',
'date_end',
),
),
'templateMeta' => array(
'maxColumns' => '3',
'maxColumnsBasic' => '4',
'widths' => array(
'label' => '10',
'field' => '30'
)
)
);
?>

View File

@@ -0,0 +1,41 @@
<?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".
********************************************************************************/
/**
* This file adds support for studio
*/
?>

View File

@@ -0,0 +1,55 @@
<?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['EcmWorkCards']['subpanel_setup'] = array(
'notes' => array(
'order' => 10,
'module' => 'Notes',
'sort_order' => 'asc',
'sort_by' => 'date_entered',
'subpanel_name' => 'default',
'get_subpanel_data' => 'notes',
'add_subpanel_data' => 'note_id',
'title_key' => 'LBL_NOTES_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
),
),
);
?>

View File

@@ -0,0 +1,72 @@
<?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".
* ****************************************************************************** */
$module_name = 'EcmWorkCards';
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => $module_name),
),
'where' => '',
'list_fields' => array(
'name' => array(
'vname' => 'LBL_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '45%',
),
'date_modified' => array(
'vname' => 'LBL_DATE_MODIFIED',
'width' => '45%',
),
'edit_button' => array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'module' => $module_name,
'width' => '4%',
),
'remove_button' => array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => $module_name,
'width' => '5%',
),
),
);
?>

128
modules/EcmWorkCards/vardefs.php Executable file
View File

@@ -0,0 +1,128 @@
<?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".
* ****************************************************************************** */
$dictionary ['EcmWorkCard'] = array(
'table' => 'ecmworkcards',
'audited' => false,
'duplicate_merge' => true,
'fields' => array(
'worker_id' => array(
'name' => 'worker_id',
'rname' => 'name',
'type' => 'id',
'module' => 'EcmWorkers',
'vname' => 'LBL_WORKER_ID',
'group' => 'worker_name',
'massupdate' => false,
'reportable' => false,
'required' => false,
),
'worker_name' => array(
'name' => 'worker_name',
'rname' => 'name',
'id_name' => 'worker_id',
'vname' => 'LBL_WORKER_NAME',
'type' => 'relate',
'group' => 'worker_name',
'dbtype' => 'varchar',
'len' => '255',
//'source'=>'non-db',
'module' => 'EcmWorkers',
'massupdate' => false,
'required' => false,
),
'date' => array(
'required' => false,
'name' => 'date',
'vname' => 'LBL_DATE',
'type' => 'date',
'default' => 'now',
'massupdate' => 0,
'no_default' => false,
'audited' => true,
),
'name' => array(
'name' => 'date',
'required' => false,
),
'date_start' => array(
'name' => 'date_start',
'vname' => 'LBL_DATE_START',
'type' => 'date',
'source' => 'non-db',
'default' => 0,
'reportable' => false
),
'date_end' => array(
'name' => 'date_end',
'vname' => 'LBL_DATE_END',
'type' => 'date',
'source' => 'non-db',
'default' => 0,
'reportable' => false
),
'notes' => array(
'name' => 'notes',
'type' => 'link',
'relationship' => 'ecmworkcards_notes',
'module' => 'Notes',
'source' => 'non-db',
'vname' => 'LBL_NOTES'
),
),
'relationships' => array(
'ecmworkcards_notes' => array(
'lhs_module' => 'EcmWorkCards',
'lhs_table' => 'ecmworkcards',
'lhs_key' => 'id',
'rhs_module' => 'Notes',
'rhs_table' => 'notes',
'rhs_key' => 'parent_id',
'relationship_type' => 'one-to-many',
'relationship_role_column' => 'parent_type',
'relationship_role_column_value' => 'EcmWorkCards'
),
),
'optimistic_locking' => true,
'unified_search' => true
);
if (!class_exists('VardefManager')) {
require_once ('include/SugarObjects/VardefManager.php');
}
VardefManager::createVardef('EcmWorkCards', 'EcmWorkCard', array(
'basic',
'assignable'
));

View File

@@ -0,0 +1,95 @@
<?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".
* *******************************************************************************/
/*
* Created on Apr 13, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
require_once('include/DetailView/DetailView2.php');
class ViewDetailMy extends SugarView{
var $type ='detail';
var $dv;
var $tplFile = 'include/DetailView/DetailView.tpl';
function ViewDetailMy(){
$this->options['show_subpanels'] = true;
parent::SugarView();
}
function preDisplay(){
$metadataFile = null;
$foundViewDefs = false;
if(file_exists('custom/modules/' . $this->module . '/metadata/detailviewdefs.php')){
$metadataFile = 'custom/modules/' . $this->module . '/metadata/detailviewdefs.php';
$foundViewDefs = true;
}else{
if(file_exists('custom/modules/'.$this->module.'/metadata/metafiles.php')){
require_once('custom/modules/'.$this->module.'/metadata/metafiles.php');
if(!empty($metafiles[$this->module]['detailviewdefs'])){
$metadataFile = $metafiles[$this->module]['detailviewdefs'];
$foundViewDefs = true;
}
}elseif(file_exists('modules/'.$this->module.'/metadata/metafiles.php')){
require_once('modules/'.$this->module.'/metadata/metafiles.php');
if(!empty($metafiles[$this->module]['detailviewdefs'])){
$metadataFile = $metafiles[$this->module]['detailviewdefs'];
$foundViewDefs = true;
}
}
}
$GLOBALS['log']->debug("metadatafile=". $metadataFile);
if(!$foundViewDefs && file_exists('modules/'.$this->module.'/metadata/detailviewdefs.php')){
$metadataFile = 'modules/'.$this->module.'/metadata/detailviewdefs.php';
}
$this->dv = new DetailView2();
$this->dv->ss =& $this->ss;
$this->dv->setup($this->module, $this->bean, $metadataFile, $this->tplFile);
}
function display(){
if(empty($this->bean->id)){
global $app_strings;
sugar_die($app_strings['ERROR_NO_RECORD']);
}
$this->dv->process();
echo $this->dv->display();
}
}

View File

@@ -0,0 +1,186 @@
<?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".
* *******************************************************************************/
/*
* Created on Apr 13, 2007
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
require_once('include/EditView/EditView2.php');
class ViewEditEcmWorkCards extends SugarView{
var $ev;
var $type ='edit';
var $useForSubpanel = false; //boolean variable to determine whether view can be used for subpanel creates
var $showTitle = true;
var $tplFile = 'include/EditView/EditView.tpl';
function ViewEditEcmWorkCards(){
parent::SugarView();
}
function preDisplay(){
$metadataFile = null;
$foundViewDefs = false;
if(file_exists('custom/modules/' . $this->module . '/metadata/editviewdefs.php')){
$metadataFile = 'custom/modules/' . $this->module . '/metadata/editviewdefs.php';
$foundViewDefs = true;
}else{
if(file_exists('custom/modules/'.$this->module.'/metadata/metafiles.php')){
require_once('custom/modules/'.$this->module.'/metadata/metafiles.php');
if(!empty($metafiles[$this->module]['editviewdefs'])){
$metadataFile = $metafiles[$this->module]['editviewdefs'];
$foundViewDefs = true;
}
}elseif(file_exists('modules/'.$this->module.'/metadata/metafiles.php')){
require_once('modules/'.$this->module.'/metadata/metafiles.php');
if(!empty($metafiles[$this->module]['editviewdefs'])){
$metadataFile = $metafiles[$this->module]['editviewdefs'];
$foundViewDefs = true;
}
}
}
$GLOBALS['log']->debug("metadatafile=". $metadataFile);
if(!$foundViewDefs && file_exists('modules/'.$this->module.'/metadata/editviewdefs.php')){
$metadataFile = 'modules/'.$this->module.'/metadata/editviewdefs.php';
}
$this->ev = new EditView();
$this->ev->ss =& $this->ss;
$this->ev->setup($this->module, $this->bean, $metadataFile, $this->tplFile);
}
function display(){
$this->ev->process();
echo $this->ev->display($this->showTitle);
}
}
?>