init
This commit is contained in:
44
modules/EcmWorkCards/DetailView.php
Normal file
44
modules/EcmWorkCards/DetailView.php
Normal 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 ();
|
||||
?>
|
||||
214
modules/EcmWorkCards/EcmWorkCard.php
Normal file
214
modules/EcmWorkCards/EcmWorkCard.php
Normal file
@@ -0,0 +1,214 @@
|
||||
<?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;
|
||||
|
||||
|
||||
$this->quantity=str_replace(",",".",str_replace(".","",$this->quantity));
|
||||
|
||||
parent::save($check_notify);
|
||||
|
||||
|
||||
if($_REQUEST['create_new']=="1"){
|
||||
|
||||
header("Location: index.php?module=EcmWorkCards&action=EditView&date=".date("d.m.Y",strtotime($this->date)));
|
||||
die();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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['TIME_FROM'] = $this->time_from.' - '.$this->time_to;
|
||||
$array['DESCRIPTION'] = $this->description;
|
||||
$array['QUANTITY'] = $this->quantity;
|
||||
$array['WORKER_NAME']='<a href="index.php?module=EcmWorkers&action=DetailView&record='.$this->worker_id.'">'.$this->worker_name.'</a>';
|
||||
$array['PRODUCT_NAME']='<a href="index.php?module=EcmProduct&action=DetailView&record='.$this->product_id.'">'.$this->product_name.'</a>';
|
||||
$array['ACTION_NAME']='<a href="index.php?module=EcmWorkers&action=DetailView&record='.$this->action_id.'">'.$this->action_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 : '[]';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
40
modules/EcmWorkCards/EditView.php
Normal file
40
modules/EcmWorkCards/EditView.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?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{
|
||||
if($_REQUEST['date']!=""){
|
||||
$focus->date = $_REQUEST['date'];
|
||||
} 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();
|
||||
?>
|
||||
44
modules/EcmWorkCards/Menu.php
Normal file
44
modules/EcmWorkCards/Menu.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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", "Raport kart pracy - Pracownicy","EcmWorkCard", 'EcmWorkCard');
|
||||
if(ACLController::checkAccess('EcmWorkCards', 'list', true))$module_menu[]=Array("index.php?module=EcmReports&action=KosztProdukcjiWgPracownikow&parentTab=Raporty", "Raport kart pracy - Produkty","EcmWorkCard", 'EcmWorkCard');
|
||||
if(ACLController::checkAccess('EcmWorkers', 'list', true))$module_menu[]=Array("index.php?module=EcmWorkers&action=Print&return_module=EcmWorkers&return_action=DetailView", 'Drukuj karty pracy',"EcmWorker", 'EcmWorker');
|
||||
143
modules/EcmWorkCards/dbpost.php
Normal file
143
modules/EcmWorkCards/dbpost.php
Normal 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 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;
|
||||
}
|
||||
|
||||
?>
|
||||
401
modules/EcmWorkCards/js/DetailViewDocumentReady.js
Normal file
401
modules/EcmWorkCards/js/DetailViewDocumentReady.js
Normal file
@@ -0,0 +1,401 @@
|
||||
$(document).ready(function () {
|
||||
var tmp = $.parseJSON($("input[name='tableEcmActions_list']").val());
|
||||
tmp = b64_to_utf8(tmp);
|
||||
tmp = $.parseJSON(tmp);
|
||||
InitializeTableEcmActions(tmp);
|
||||
|
||||
var sumanetto = 0;
|
||||
var sumabrutto = 0;
|
||||
$.each(tmp, function (key, value) {
|
||||
sumanetto = sumanetto + UnformatNumber(value['ecmactioncost_display']);
|
||||
sumabrutto = sumabrutto + UnformatNumber(value['costbrutto_display']);
|
||||
});
|
||||
$('#sum_netto').text(FormatNumber(sumanetto));
|
||||
$('#sum_brutto').text(FormatNumber(sumabrutto));
|
||||
});
|
||||
|
||||
function InitializeTableEcmActions(tmp) {
|
||||
$('#tableEcmActions').appendGrid({
|
||||
hideRowNumColumn: true,
|
||||
initData: tmp,
|
||||
initRows: 0,
|
||||
columns: [
|
||||
{
|
||||
name: 'produkt',
|
||||
display: 'Produkt',
|
||||
type: 'custom',
|
||||
ctrlClass: 'inputs',
|
||||
ctrlAttr : {readonly : 'readonly'},
|
||||
displayCss: {
|
||||
// 'width': '30%',
|
||||
'vertical-align': 'middle',
|
||||
'text-align': 'center',
|
||||
'background-color': 'rgb(224,240,255)',
|
||||
'border': '1px solid rgb(48,192,255)',
|
||||
'height': '0px',
|
||||
'font-family': 'Arial',
|
||||
'font-size': '12px',
|
||||
'color': 'black',
|
||||
},
|
||||
value: ['', '', ''],
|
||||
customBuilder: function (parent, idPrefix, name, uniqueIndex) {
|
||||
// Prepare the control ID/name by using idPrefix, column name and uniqueIndex
|
||||
var ctrlId = idPrefix + '_' + name + '_table_' + uniqueIndex;
|
||||
var upperRowId = idPrefix + '_' + name + '_upperRow_' + uniqueIndex;
|
||||
var lowerRowId = idPrefix + '_' + name + '_lowerRow_' + uniqueIndex;
|
||||
var upperCellId = idPrefix + '_' + name + '_upperCell_' + uniqueIndex;
|
||||
var lowerCellId = idPrefix + '_' + name + '_lowerCell_' + uniqueIndex;
|
||||
|
||||
var ctrl = document.createElement('table');
|
||||
$(ctrl).attr({ id: ctrlId, name: ctrlId }).appendTo(parent);
|
||||
$(ctrl).css('border', '0px solid white');
|
||||
$(ctrl).addClass('positions');
|
||||
|
||||
var upperRow = document.createElement('tr');
|
||||
$(upperRow).attr({ id: upperRowId, name: upperRowId }).appendTo(ctrl);
|
||||
$(upperRow).css('border', '0px solid white');
|
||||
|
||||
var lowerRow = document.createElement('tr');
|
||||
$(lowerRow).attr({ id: lowerRowId, name: lowerRowId }).appendTo(ctrl);
|
||||
$(lowerRow).css('border', '0px solid white');
|
||||
|
||||
var upperCell = document.createElement('td');
|
||||
$(upperCell).attr({ id: upperCellId, name: upperCellId }).appendTo(upperRow);
|
||||
$(upperCell).css('border', '0px solid white');
|
||||
upperCell.style.overflow = "hidden";
|
||||
|
||||
var lowerCell = document.createElement('td');
|
||||
$(lowerCell).attr({ id: lowerCellId, name: lowerCellId }).appendTo(lowerRow);
|
||||
$(lowerCell).css('border', '0px solid white');
|
||||
lowerCell.style.overflow = "hidden";
|
||||
// Create extra controls and add to container
|
||||
// Finally, return the container control
|
||||
return ctrl;
|
||||
},
|
||||
customGetter: function (idPrefix, name, uniqueIndex) {
|
||||
return '0';
|
||||
},
|
||||
customSetter: function (idPrefix, name, uniqueIndex, value) {
|
||||
var upperCellId = idPrefix + '_' + name + '_upperCell_' + uniqueIndex;
|
||||
var lowerCellId = idPrefix + '_' + name + '_lowerCell_' + uniqueIndex;
|
||||
|
||||
if( Object.prototype.toString.call( value ) === '[object Array]' ) {
|
||||
var indeksUrl = document.createElement('a');
|
||||
indeksUrl.href = 'index.php?module=EcmProducts&return_module=EcmProducts&action=DetailView&record=' + value[2];
|
||||
indeksUrl.onclick = function (){
|
||||
window.open('index.php?module=EcmProducts&return_module=EcmProducts&action=DetailView&record=' + value[2],'1426150651552','width=700,height=500,toolbar=0,menubar=0,location=0,status=0,scrollbars=1,resizable=1,left=0,top=0');
|
||||
return false;
|
||||
};
|
||||
indeksUrl.title = value[0];
|
||||
indeksUrl.textContent = value[0];
|
||||
|
||||
var nazwaUrl = document.createElement('a');
|
||||
nazwaUrl.href = 'index.php?module=EcmProducts&return_module=EcmProducts&action=DetailView&record=' + value[2];
|
||||
nazwaUrl.onclick = function (){
|
||||
window.open('index.php?module=EcmProducts&return_module=EcmProducts&action=DetailView&record=' + value[2],'1426150651552','width=700,height=500,toolbar=0,menubar=0,location=0,status=0,scrollbars=1,resizable=1,left=0,top=0');
|
||||
return false;
|
||||
};
|
||||
nazwaUrl.title = value[1];
|
||||
if (typeof value[1] === "undefined") {
|
||||
nazwaUrl.textContent = value[1];
|
||||
}else{
|
||||
nazwaUrl.textContent = value[1].replace('"','"');
|
||||
}
|
||||
|
||||
$('#' + upperCellId).html(indeksUrl);
|
||||
$('#' + lowerCellId).html(nazwaUrl);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
name: 'czynnosc',
|
||||
display: 'Czynność',
|
||||
type: 'custom',
|
||||
ctrlClass: 'inputs',
|
||||
ctrlAttr : {readonly : 'readonly'},
|
||||
displayCss: {
|
||||
// 'width': '30%',
|
||||
'vertical-align': 'middle',
|
||||
'text-align': 'center',
|
||||
'background-color': 'rgb(224,240,255)',
|
||||
'border': '1px solid rgb(48,192,255)',
|
||||
'height': '0px',
|
||||
'font-family': 'Arial',
|
||||
'font-size': '12px',
|
||||
'color': 'black',
|
||||
},
|
||||
value: ['', '', ''],
|
||||
customBuilder: function (parent, idPrefix, name, uniqueIndex) {
|
||||
// Prepare the control ID/name by using idPrefix, column name and uniqueIndex
|
||||
var ctrlId = idPrefix + '_' + name + '_table_' + uniqueIndex;
|
||||
var upperRowId = idPrefix + '_' + name + '_upperRow_' + uniqueIndex;
|
||||
var lowerRowId = idPrefix + '_' + name + '_lowerRow_' + uniqueIndex;
|
||||
var upperCellId = idPrefix + '_' + name + '_upperCell_' + uniqueIndex;
|
||||
var lowerCellId = idPrefix + '_' + name + '_lowerCell_' + uniqueIndex;
|
||||
|
||||
var ctrl = document.createElement('table');
|
||||
$(ctrl).attr({ id: ctrlId, name: ctrlId }).appendTo(parent);
|
||||
$(ctrl).css('border', '0px solid white');
|
||||
$(ctrl).addClass('positions');
|
||||
|
||||
var upperRow = document.createElement('tr');
|
||||
$(upperRow).attr({ id: upperRowId, name: upperRowId }).appendTo(ctrl);
|
||||
$(upperRow).css('border', '0px solid white');
|
||||
|
||||
var lowerRow = document.createElement('tr');
|
||||
$(lowerRow).attr({ id: lowerRowId, name: lowerRowId }).appendTo(ctrl);
|
||||
$(lowerRow).css('border', '0px solid white');
|
||||
|
||||
var upperCell = document.createElement('td');
|
||||
$(upperCell).attr({ id: upperCellId, name: upperCellId }).appendTo(upperRow);
|
||||
$(upperCell).css('border', '0px solid white');
|
||||
upperCell.style.overflow = "hidden";
|
||||
|
||||
var lowerCell = document.createElement('td');
|
||||
$(lowerCell).attr({ id: lowerCellId, name: lowerCellId }).appendTo(lowerRow);
|
||||
$(lowerCell).css('border', '0px solid white');
|
||||
lowerCell.style.overflow = "hidden";
|
||||
// Create extra controls and add to container
|
||||
// Finally, return the container control
|
||||
return ctrl;
|
||||
},
|
||||
customGetter: function (idPrefix, name, uniqueIndex) {
|
||||
return '0';
|
||||
},
|
||||
customSetter: function (idPrefix, name, uniqueIndex, value) {
|
||||
var upperCellId = idPrefix + '_' + name + '_upperCell_' + uniqueIndex;
|
||||
var lowerCellId = idPrefix + '_' + name + '_lowerCell_' + uniqueIndex;
|
||||
|
||||
if( Object.prototype.toString.call( value ) === '[object Array]' ) {
|
||||
var indeksUrl = document.createElement('a');
|
||||
indeksUrl.href = 'index.php?module=EcmProducts&return_module=EcmProducts&action=DetailView&record=' + value[2];
|
||||
indeksUrl.onclick = function (){
|
||||
window.open('index.php?module=EcmProducts&return_module=EcmProducts&action=DetailView&record=' + value[2],'1426150651552','width=700,height=500,toolbar=0,menubar=0,location=0,status=0,scrollbars=1,resizable=1,left=0,top=0');
|
||||
return false;
|
||||
};
|
||||
indeksUrl.title = value[0];
|
||||
indeksUrl.textContent = value[0];
|
||||
|
||||
var nazwaUrl = document.createElement('a');
|
||||
nazwaUrl.href = 'index.php?module=EcmActions&return_module=EcmActions&action=DetailView&record=' + value[2];
|
||||
nazwaUrl.onclick = function (){
|
||||
window.open('index.php?module=EcmActions&return_module=EcmActions&action=DetailView&record=' + value[2],'1426150651552','width=700,height=500,toolbar=0,menubar=0,location=0,status=0,scrollbars=1,resizable=1,left=0,top=0');
|
||||
return false;
|
||||
};
|
||||
nazwaUrl.title = value[1];
|
||||
nazwaUrl.textContent = value[1];
|
||||
$('#' + upperCellId).html(indeksUrl);
|
||||
$('#' + lowerCellId).html(nazwaUrl);
|
||||
}
|
||||
}
|
||||
}, {
|
||||
name: 'quantity',
|
||||
display: 'Ilość',
|
||||
type: 'text',
|
||||
ctrlClass: 'inputs',
|
||||
ctrlAttr : {readonly : 'readonly'},
|
||||
ctrlCss: {'text-align': 'right'},
|
||||
displayCss: {
|
||||
'width': '50px',
|
||||
'vertical-align': 'middle',
|
||||
'text-align': 'center',
|
||||
'background-color': 'rgb(224,240,255)',
|
||||
'border': '1px solid rgb(48,192,255)',
|
||||
'height': '0px',
|
||||
'font-family': 'Arial',
|
||||
'font-size': '12px',
|
||||
'color': 'black',}
|
||||
},{
|
||||
name: 'netto',
|
||||
display: ' Cena / Wartość netto',
|
||||
type: 'custom',
|
||||
ctrlClass: 'inputs',
|
||||
ctrlAttr : {readonly : 'readonly'},
|
||||
displayCss: {
|
||||
'width': '130px',
|
||||
'vertical-align': 'middle',
|
||||
'text-align': 'center',
|
||||
'background-color': 'rgb(224,240,255)',
|
||||
'border': '1px solid rgb(48,192,255)',
|
||||
'height': '0px',
|
||||
'font-family': 'Arial',
|
||||
'font-size': '12px',
|
||||
'color': 'black',
|
||||
},
|
||||
value: ['', ''],
|
||||
customBuilder: function (parent, idPrefix, name, uniqueIndex) {
|
||||
// Prepare the control ID/name by using idPrefix, column name and uniqueIndex
|
||||
var ctrlId = idPrefix + '_' + name + '_table_' + uniqueIndex;
|
||||
var upperRowId = idPrefix + '_' + name + '_upperRow_' + uniqueIndex;
|
||||
var lowerRowId = idPrefix + '_' + name + '_lowerRow_' + uniqueIndex;
|
||||
var upperCellId = idPrefix + '_' + name + '_upperCell_' + uniqueIndex;
|
||||
var lowerCellId = idPrefix + '_' + name + '_lowerCell_' + uniqueIndex;
|
||||
|
||||
var ctrl = document.createElement('table');
|
||||
$(ctrl).attr({ id: ctrlId, name: ctrlId }).appendTo(parent);
|
||||
$(ctrl).css('border', '0px solid white');
|
||||
$(ctrl).addClass('positions');
|
||||
|
||||
var upperRow = document.createElement('tr');
|
||||
$(upperRow).attr({ id: upperRowId, name: upperRowId }).appendTo(ctrl);
|
||||
$(upperRow).css('border', '0px solid white');
|
||||
|
||||
var lowerRow = document.createElement('tr');
|
||||
$(lowerRow).attr({ id: lowerRowId, name: lowerRowId }).appendTo(ctrl);
|
||||
$(lowerRow).css('border', '0px solid white');
|
||||
|
||||
var upperCell = document.createElement('td');
|
||||
$(upperCell).attr({ id: upperCellId, name: upperCellId }).appendTo(upperRow);
|
||||
$(upperCell).css('border', '0px solid white');
|
||||
$(upperCell).css('text-align', 'right');
|
||||
upperCell.style.overflow = "hidden";
|
||||
|
||||
var lowerCell = document.createElement('td');
|
||||
$(lowerCell).attr({ id: lowerCellId, name: lowerCellId }).appendTo(lowerRow);
|
||||
$(lowerCell).css('border', '0px solid white');
|
||||
$(lowerCell).css('text-align', 'right');
|
||||
lowerCell.style.overflow = "hidden";
|
||||
// Create extra controls and add to container
|
||||
// Finally, return the container control
|
||||
return ctrl;
|
||||
},
|
||||
customGetter: function (idPrefix, name, uniqueIndex) {
|
||||
return '0';
|
||||
},
|
||||
customSetter: function (idPrefix, name, uniqueIndex, value) {
|
||||
var upperCellId = idPrefix + '_' + name + '_upperCell_' + uniqueIndex;
|
||||
var lowerCellId = idPrefix + '_' + name + '_lowerCell_' + uniqueIndex;
|
||||
if( Object.prototype.toString.call( value ) === '[object Array]' ) {
|
||||
$('#' + upperCellId).html(value[0]);
|
||||
$('#' + lowerCellId).html(value[1]);
|
||||
}
|
||||
}
|
||||
},{
|
||||
name: 'brutto',
|
||||
display: ' Cena / Wartość brutto',
|
||||
type: 'custom',
|
||||
ctrlClass: 'inputs',
|
||||
ctrlAttr : {readonly : 'readonly'},
|
||||
displayCss: {
|
||||
'width': '130px',
|
||||
'vertical-align': 'middle',
|
||||
'text-align': 'center',
|
||||
'background-color': 'rgb(224,240,255)',
|
||||
'border': '1px solid rgb(48,192,255)',
|
||||
'height': '0px',
|
||||
'font-family': 'Arial',
|
||||
'font-size': '12px',
|
||||
'color': 'black',
|
||||
},
|
||||
value: ['', ''],
|
||||
customBuilder: function (parent, idPrefix, name, uniqueIndex) {
|
||||
// Prepare the control ID/name by using idPrefix, column name and uniqueIndex
|
||||
var ctrlId = idPrefix + '_' + name + '_table_' + uniqueIndex;
|
||||
var upperRowId = idPrefix + '_' + name + '_upperRow_' + uniqueIndex;
|
||||
var lowerRowId = idPrefix + '_' + name + '_lowerRow_' + uniqueIndex;
|
||||
var upperCellId = idPrefix + '_' + name + '_upperCell_' + uniqueIndex;
|
||||
var lowerCellId = idPrefix + '_' + name + '_lowerCell_' + uniqueIndex;
|
||||
|
||||
var ctrl = document.createElement('table');
|
||||
$(ctrl).attr({ id: ctrlId, name: ctrlId }).appendTo(parent);
|
||||
$(ctrl).css('border', '0px solid white');
|
||||
$(ctrl).addClass('positions');
|
||||
|
||||
var upperRow = document.createElement('tr');
|
||||
$(upperRow).attr({ id: upperRowId, name: upperRowId }).appendTo(ctrl);
|
||||
$(upperRow).css('border', '0px solid white');
|
||||
|
||||
var lowerRow = document.createElement('tr');
|
||||
$(lowerRow).attr({ id: lowerRowId, name: lowerRowId }).appendTo(ctrl);
|
||||
$(lowerRow).css('border', '0px solid white');
|
||||
|
||||
var upperCell = document.createElement('td');
|
||||
$(upperCell).attr({ id: upperCellId, name: upperCellId }).appendTo(upperRow);
|
||||
$(upperCell).css('border', '0px solid white');
|
||||
$(upperCell).css('text-align', 'right');
|
||||
upperCell.style.overflow = "hidden";
|
||||
|
||||
var lowerCell = document.createElement('td');
|
||||
$(lowerCell).attr({ id: lowerCellId, name: lowerCellId }).appendTo(lowerRow);
|
||||
$(lowerCell).css('border', '0px solid white');
|
||||
$(lowerCell).css('text-align', 'right');
|
||||
lowerCell.style.overflow = "hidden";
|
||||
// Create extra controls and add to container
|
||||
// Finally, return the container control
|
||||
return ctrl;
|
||||
},
|
||||
customGetter: function (idPrefix, name, uniqueIndex) {
|
||||
return '0';
|
||||
},
|
||||
customSetter: function (idPrefix, name, uniqueIndex, value) {
|
||||
var upperCellId = idPrefix + '_' + name + '_upperCell_' + uniqueIndex;
|
||||
var lowerCellId = idPrefix + '_' + name + '_lowerCell_' + uniqueIndex;
|
||||
if( Object.prototype.toString.call( value ) === '[object Array]' ) {
|
||||
$('#' + upperCellId).html(value[0]);
|
||||
$('#' + lowerCellId).html(value[1]);
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
i18n: {
|
||||
rowEmpty: 'Brak rekordów'
|
||||
},
|
||||
hideButtons: {
|
||||
removeLast: true,
|
||||
append: true,
|
||||
insert: true,
|
||||
remove : true,
|
||||
moveUp: true,
|
||||
moveDown: true
|
||||
}
|
||||
});
|
||||
$('thead').removeClass('ui-widget-header');
|
||||
$('td').removeClass('ui-widget-header');
|
||||
$('tbody').removeClass('ui-widget-content');
|
||||
$('td').removeClass('ui-widget-content');
|
||||
$('tfoot').removeClass('ui-widget-header');
|
||||
}
|
||||
|
||||
function FormatNumber(number, precision) {
|
||||
var precision = precision || 2;
|
||||
// make string..
|
||||
number = number + '';
|
||||
number = number.replace(',', '.');
|
||||
// round
|
||||
number = toFixed(number, precision);
|
||||
// add 1000 sep
|
||||
var tmp = number.split(".");
|
||||
var c = '';
|
||||
for (var i = tmp[0].length; i != -1; i--) {
|
||||
c += tmp[0].charAt(i);
|
||||
if ((tmp[0].length - i) == 0 || i == 0)
|
||||
continue;
|
||||
if ((tmp[0].length - i) % 3 == 0)
|
||||
c += '.';
|
||||
}
|
||||
// reverse c
|
||||
c = c.split("").reverse().join("");
|
||||
return c + ',' + tmp[1];
|
||||
}
|
||||
|
||||
function toFixed(value, precision) {
|
||||
var precision = precision || 0,
|
||||
neg = value < 0, power = Math.pow(10, precision),
|
||||
value = Math.round(value * power),
|
||||
integral = String((neg ? Math.ceil : Math.floor)(value / power)),
|
||||
fraction = String((neg ? -value : value) % power),
|
||||
padding = new Array(Math.max(precision - fraction.length, 0) + 1).join('0');
|
||||
//fix problem with Math.floor and Math.ceil with result zero (lose sign)
|
||||
if (neg && integral=="0")
|
||||
integral='-'+integral;
|
||||
return precision ? integral + '.' + padding + fraction : integral;
|
||||
}
|
||||
|
||||
function UnformatNumber(number) {
|
||||
// make string..
|
||||
number = number + '';
|
||||
// remove 1000 sep
|
||||
number = number.replace(/\./g, '');
|
||||
// change ',' to '.'
|
||||
number = number.replace(',', '.');
|
||||
return parseFloat(number);
|
||||
}
|
||||
563
modules/EcmWorkCards/js/EditViewDocumentReady6.js
Normal file
563
modules/EcmWorkCards/js/EditViewDocumentReady6.js
Normal file
@@ -0,0 +1,563 @@
|
||||
var tabAction = $('#tableEcmActions');
|
||||
|
||||
$(document).ready(function () {
|
||||
//addToValidate('EditView','quantity','income_cycle_c',true,'');
|
||||
addToValidate('EditView','date_from','income_cycle_c',true,'');
|
||||
addToValidate('EditView','date_to','income_cycle_c',true,'');
|
||||
$('#time_from').timepicker({ 'timeFormat': 'H:i:s','step':15 });
|
||||
$('#time_to').timepicker({ 'timeFormat': 'H:i:s' ,'step':15});
|
||||
$('#worker_name').attr('tabindex',201);
|
||||
$('#date').attr('tabindex',202);
|
||||
$('#product_name').attr('tabindex',203);
|
||||
$('#action_name').attr('tabindex',204);
|
||||
$('#time_from').attr('tabindex',205);
|
||||
$('#time_to').attr('tabindex',206);
|
||||
$('#quantity').attr('tabindex',207);
|
||||
$('#description').attr('tabindex',208);
|
||||
$('#worker_name').focus();
|
||||
lockEnter();
|
||||
|
||||
$( "#product_name" ).autocomplete({
|
||||
source: function (request, response)
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
url: 'index.php',
|
||||
dataType: "json",
|
||||
data:
|
||||
{
|
||||
query: request.term,
|
||||
to_pdf: 'true',
|
||||
type: 'EcmProducts',
|
||||
module: 'Home',
|
||||
action: 'customSearch',
|
||||
},
|
||||
success: function (data)
|
||||
{
|
||||
response($.map(data.fields, function (item) {
|
||||
return {
|
||||
label: item.code,
|
||||
value: item.code,
|
||||
id: item.id,
|
||||
};
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
minLength: 2,
|
||||
select: function( event, ui ) {
|
||||
$('#product_id').val(ui.item.id);
|
||||
}
|
||||
});
|
||||
|
||||
$( "#action_name" ).autocomplete({
|
||||
source: function (request, response)
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
url: 'index.php',
|
||||
dataType: "json",
|
||||
data:
|
||||
{
|
||||
query: request.term,
|
||||
to_pdf: 'true',
|
||||
type: 'EcmActions',
|
||||
module: 'Home',
|
||||
action: 'customSearch',
|
||||
},
|
||||
success: function (data)
|
||||
{
|
||||
response($.map(data.fields, function (item) {
|
||||
return {
|
||||
label: item.name,
|
||||
value: item.name,
|
||||
id: item.id,
|
||||
};
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
minLength: 2,
|
||||
select: function( event, ui ) {
|
||||
$('#action_id').val(ui.item.id);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).keypress(function(event) {
|
||||
var keycode = (event.keyCode ? event.keyCode : event.which);
|
||||
if(keycode == '9') { //onEnter
|
||||
var tabindex= $(this.activeElement).attr("tabindex");
|
||||
if(tabindex==209){
|
||||
$('#worker_name').select();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$["ui"]["autocomplete"].prototype["_renderItem"] = function (ul, item) {
|
||||
return $("<li></li>").data("item.autocomplete", item).append(
|
||||
$("<a></a>").html(item.label)).appendTo(ul);
|
||||
};
|
||||
|
||||
function InitializeTableEcmActions() {
|
||||
tabAction.appendGrid({
|
||||
hideRowNumColumn: true,
|
||||
initRows: 1,
|
||||
columns: [
|
||||
{
|
||||
name: 'code',
|
||||
display: 'Indeks',
|
||||
type: 'ui-autocomplete',
|
||||
ctrlClass: 'inputs',
|
||||
displayCss: {'width': '10%', 'vertical-align': 'middle'},
|
||||
uiOption: {
|
||||
source: function (request, response) {
|
||||
getProductIndeks(request, response);
|
||||
},
|
||||
minLength: 1,
|
||||
delay: 1500,
|
||||
select: function (event, ui) {
|
||||
if (ui.item.id != '') {
|
||||
var rowIndex = event.target.id.split("_").pop();
|
||||
rowIndex = $('#tableEcmActions').appendGrid('getRowIndex', rowIndex)
|
||||
setProductActions(rowIndex, ui.item);
|
||||
}
|
||||
},
|
||||
},
|
||||
}, {
|
||||
name: 'ecmproductname',
|
||||
display: 'Nazwa produktu',
|
||||
type: 'ui-autocomplete',
|
||||
ctrlClass: 'inputs',
|
||||
displayCss: {'width': '32%', 'vertical-align': 'middle'},
|
||||
uiOption: {
|
||||
source: function (request, response) {
|
||||
getProductName(request, response);
|
||||
},
|
||||
delay: 1500,
|
||||
minLength: 1,
|
||||
select: function (event, ui) {
|
||||
if (ui.item.id != '') {
|
||||
var rowIndex = event.target.id.split("_").pop();
|
||||
rowIndex = $('#tableEcmActions').appendGrid('getRowIndex', rowIndex)
|
||||
setProductActions(rowIndex, ui.item);
|
||||
}
|
||||
},
|
||||
},
|
||||
}, {
|
||||
name: 'ecmaction',
|
||||
display: 'Indeks - Nazwa czynności',
|
||||
type: 'select',
|
||||
ctrlOptions: {0: 'Wyszukaj produkt'},
|
||||
ctrlAttr: {disabled: 'disabled'},
|
||||
ctrlClass: 'inputs',
|
||||
displayCss: {'width': '32%', 'vertical-align': 'middle'},
|
||||
emptyCriteria: function (value) {
|
||||
return (value <= 0);
|
||||
},
|
||||
onChange: function (evt, rowIndex) {
|
||||
selectChange(evt, rowIndex);
|
||||
},
|
||||
}, {
|
||||
name: 'quantity',
|
||||
display: 'Ilość',
|
||||
type: 'text',
|
||||
ctrlClass: 'inputs',
|
||||
value: '0',
|
||||
ctrlCss: {'text-align': 'right'},
|
||||
onChange: function (evt, rowIndex) {
|
||||
var quantity = (isNaN(parseFloat(evt.target.value))) ? '0' : parseFloat(evt.target.value);
|
||||
var costvalue = $('#tableEcmActions').appendGrid('getCtrlValue', 'ecmactioncost', rowIndex);
|
||||
var bruttovalue = $('#tableEcmActions').appendGrid('getCtrlValue', 'costbrutto', rowIndex);
|
||||
$('#tableEcmActions').appendGrid('setCtrlValue', 'quantity', rowIndex, quantity);
|
||||
$('#tableEcmActions').appendGrid('setCtrlValue', 'ecmactioncost_display', rowIndex, FormatNumber(quantity * costvalue));
|
||||
$('#tableEcmActions').appendGrid('setCtrlValue', 'costbrutto_display', rowIndex, FormatNumber(quantity * bruttovalue));
|
||||
updateSum(evt, rowIndex);
|
||||
},
|
||||
displayCss: {'width': '50px', 'vertical-align': 'middle'},
|
||||
emptyCriteria: function (value) {
|
||||
// A value lesser than zero will consider as empty.
|
||||
return (value <= 0);
|
||||
}
|
||||
}, {
|
||||
name: 'ecmactioncost_single_netto',
|
||||
type: 'text',
|
||||
ctrlClass: 'inputs',
|
||||
display: 'Netto',
|
||||
ctrlCss: {'text-align': 'right'},
|
||||
ctrlAttr: {readonly: 'readonly', 'disabled': 'disabled'},
|
||||
displayCss: {'width': '40px', 'vertical-align': 'middle'},
|
||||
invisible: true,
|
||||
},{
|
||||
name: 'ecmactioncost_single_brutto',
|
||||
type: 'text',
|
||||
ctrlClass: 'inputs',
|
||||
display: 'Brutto',
|
||||
ctrlCss: {'text-align': 'right'},
|
||||
ctrlAttr: {readonly: 'readonly', 'disabled': 'disabled'},
|
||||
displayCss: {'width': '40px', 'vertical-align': 'middle'},
|
||||
invisible: true,
|
||||
}, {
|
||||
name: 'ecmactioncost_display',
|
||||
display: 'Wartość netto',
|
||||
type: 'text',
|
||||
ctrlClass: 'inputs',
|
||||
value: '0,00',
|
||||
ctrlCss: {'text-align': 'right'},
|
||||
ctrlAttr: {readonly: 'readonly', 'disabled': 'disabled'},
|
||||
displayCss: {'width': '90px', 'vertical-align': 'middle'},
|
||||
}, {
|
||||
name: 'costbrutto_display',
|
||||
display: 'Wartość brutto',
|
||||
type: 'text',
|
||||
ctrlClass: 'inputs',
|
||||
value: '0,00',
|
||||
invisible: false,
|
||||
ctrlCss: {'text-align': 'right'},
|
||||
ctrlAttr: {readonly: 'readonly', 'disabled': 'disabled'},
|
||||
displayCss: {'width': '90px', 'vertical-align': 'middle'},
|
||||
}, {
|
||||
name: 'ecmproductid',
|
||||
type: 'text',
|
||||
display: 'ecmproductid',
|
||||
invisible: true,
|
||||
}, {
|
||||
name: 'ecmactioncost',
|
||||
type: 'text',
|
||||
display: 'ecmactioncost',
|
||||
invisible: true,
|
||||
}, {
|
||||
name: 'costbrutto',
|
||||
type: 'text',
|
||||
display: 'costbrutto',
|
||||
invisible: true,
|
||||
}
|
||||
],
|
||||
i18n: {
|
||||
rowEmpty: 'Brak rekordów',
|
||||
append: 'Dodaj rekord',
|
||||
insert: 'Skopiuj rekord',
|
||||
remove: 'Usuń rekord',
|
||||
},
|
||||
customGridButtons: {
|
||||
insert: function () {
|
||||
var button = document.createElement('img');
|
||||
button.src = 'modules/EcmQuotes/images/add_position.gif';
|
||||
return button;
|
||||
},
|
||||
moveUp: function () {
|
||||
var button = document.createElement('img');
|
||||
button.src = 'modules/EcmQuotes/images/moverowup.gif';
|
||||
return button;
|
||||
},
|
||||
moveDown: function () {
|
||||
var button = document.createElement('img');
|
||||
button.src = 'modules/EcmQuotes/images/moverowdown.gif';
|
||||
return button;
|
||||
},
|
||||
removeLast: function () {
|
||||
var button = document.createElement('img');
|
||||
button.src = 'modules/EcmQuotes/images/deleterow.gif';
|
||||
return button;
|
||||
},
|
||||
append: function () {
|
||||
var button = document.createElement('img');
|
||||
button.src = 'modules/EcmQuotes/images/insertrow.gif';
|
||||
return button;
|
||||
},
|
||||
remove: function () {
|
||||
var button = document.createElement('img');
|
||||
button.src = 'modules/EcmQuotes/images/deleterow.gif';
|
||||
return button;
|
||||
},
|
||||
},
|
||||
hideButtons: {
|
||||
removeLast: true,
|
||||
//append: true,
|
||||
//insert: true,
|
||||
//remove : true,
|
||||
moveUp: true,
|
||||
moveDown: true,
|
||||
}
|
||||
});
|
||||
$('thead').removeClass('ui-widget-header');
|
||||
$('td').removeClass('ui-widget-header');
|
||||
$('tbody').removeClass('ui-widget-content');
|
||||
$('td').removeClass('ui-widget-content');
|
||||
$('tfoot').removeClass('ui-widget-header');
|
||||
}
|
||||
|
||||
function getProductName(request, response) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=EcmWorkCards&action=dbpost&to_pdf=1",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: {
|
||||
job: "ecmProductNameAutocomplite",
|
||||
name: request.term,
|
||||
},
|
||||
success: function (data) {
|
||||
response(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getProductIndeks(request, response) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=EcmWorkCards&action=dbpost&to_pdf=1",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: {
|
||||
job: "ecmProductIndeksAutocomplite",
|
||||
indeks: request.term,
|
||||
},
|
||||
success: function (data) {
|
||||
response(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function selectChange(evt, rowIndex) {
|
||||
var jr = $('#' + evt.target.id + '').find(":selected").val();
|
||||
var cost = '';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=EcmWorkCards&action=dbpost&to_pdf=1",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: {
|
||||
job: "getEcmActionsCost",
|
||||
id: jr,
|
||||
},
|
||||
success: function (data) {
|
||||
cost = data;
|
||||
}
|
||||
});
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmactioncost', rowIndex, cost['cost_other']);
|
||||
tabAction.appendGrid('setCtrlValue', 'costbrutto', rowIndex, cost['cost_action']);
|
||||
var quantity = $('#tableEcmActions').appendGrid('getCtrlValue', 'quantity', rowIndex);
|
||||
quantity = parseFloat(quantity);
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmactioncost_display', rowIndex, FormatNumber(quantity * cost));
|
||||
}
|
||||
|
||||
function setProductActions(rowIndex, item) {
|
||||
var czynnosci = '';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=EcmWorkCards&action=dbpost&to_pdf=1",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: {
|
||||
job: "getProductActions",
|
||||
id: item.id,
|
||||
},
|
||||
success: function (data) {
|
||||
czynnosci = data;
|
||||
}
|
||||
});
|
||||
if (czynnosci.length > 0) {
|
||||
$.each(czynnosci, function (key, value) {
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmproductid', rowIndex, item.id);
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmproductname', rowIndex, item.ecmproductname);
|
||||
tabAction.appendGrid('setCtrlValue', 'code', rowIndex, item.code);
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmactioncost', rowIndex, value.ecmactioncost);
|
||||
tabAction.appendGrid('setCtrlValue', 'costbrutto', rowIndex, value.costbrutto);
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmactioncost_single_netto', rowIndex, FormatNumber(value.ecmactioncost));
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmactioncost_single_brutto', rowIndex, FormatNumber(value.costbrutto));
|
||||
var selekt = tabAction.appendGrid('getCellCtrl', 'ecmaction', rowIndex);
|
||||
selekt.options.length = 1;
|
||||
$.each(czynnosci, function (key2, value2) {
|
||||
if (value.id != value2.id) {
|
||||
selekt.options[key2] = new Option(value2.name, value2.id);
|
||||
} else {
|
||||
selekt.options[key2] = new Option(value2.name, value2.id, true, true);
|
||||
}
|
||||
});
|
||||
selekt.disabled = false;
|
||||
if (key != czynnosci.length - 1) {
|
||||
tabAction.appendGrid('insertRow', 1, rowIndex);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmproductid', rowIndex, item.id);
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmproductname', rowIndex, item.ecmproductname);
|
||||
tabAction.appendGrid('setCtrlValue', 'code', rowIndex, item.code);
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmactioncost', rowIndex, item.ecmactioncost);
|
||||
tabAction.appendGrid('setCtrlValue', 'costbrutto', rowIndex, item.costbrutto);
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmactioncost_single_netto', rowIndex, FormatNumber(item.ecmactioncost));
|
||||
tabAction.appendGrid('setCtrlValue', 'ecmactioncost_single_brutto', rowIndex, FormatNumber(item.costbrutto));
|
||||
var selekt = tabAction.appendGrid('getCellCtrl', 'ecmaction', rowIndex);
|
||||
if (selekt != null) {
|
||||
selekt.options.length = 1;
|
||||
selekt.options[0] = new Option('Brak przypisanych czynności', 0);
|
||||
selekt.disabled = true;
|
||||
}
|
||||
}
|
||||
tabAction.appendGrid('removeEmptyRows');
|
||||
tabAction.appendGrid('appendRow', 1);
|
||||
$("input[type='text']").on("focus", function () {
|
||||
$(this).select();
|
||||
});
|
||||
tabAction.appendGrid('getCellCtrl', 'quantity', rowIndex).focus();
|
||||
}
|
||||
|
||||
function loadData() {
|
||||
var action_list = $.parseJSON($("input[name='tableEcmActions_list']").val());
|
||||
if(action_list != '[]'){
|
||||
action_list = b64_to_utf8(action_list);
|
||||
action_list = $.parseJSON(action_list);
|
||||
}
|
||||
if (action_list.length > 0 && action_list != '[]') {
|
||||
$.each(action_list, function (idx2, obj2) {
|
||||
tabAction.appendGrid('insertRow', [{
|
||||
ecmproductid: obj2.ecmproductid,
|
||||
quantity: obj2.quantity,
|
||||
ecmproductname: obj2.ecmproductname,
|
||||
code: obj2.code,
|
||||
ecmactioncost: obj2.ecmactioncost,
|
||||
ecmactioncost_display: obj2.ecmactioncost_display,
|
||||
costbrutto: obj2.costbrutto,
|
||||
costbrutto_display: obj2.costbrutto_display,
|
||||
ecmactioncost_single_netto: obj2.ecmactioncost_single_netto,
|
||||
ecmactioncost_single_brutto: obj2.ecmactioncost_single_brutto,
|
||||
}], 0);
|
||||
setDisabled(0);
|
||||
var tmp;
|
||||
var elem2 = tabAction.appendGrid('getCellCtrl', 'ecmaction', 0);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "index.php?module=EcmWorkCards&action=dbpost&to_pdf=1",
|
||||
dataType: "json",
|
||||
async: false,
|
||||
data: {
|
||||
job: "getProductActionsLoad",
|
||||
id: obj2.ecmproductid,
|
||||
},
|
||||
success: function (data) {
|
||||
tmp = data;
|
||||
}
|
||||
});
|
||||
//wstawianie do selecta
|
||||
elem2.options.length = 1;
|
||||
elem2.options[0] = new Option('Brak przypisanych czynności', 0);
|
||||
if (0 < tmp.length) {
|
||||
// Generate options for elem2
|
||||
$.each(tmp, function (key, value) {
|
||||
if (value.id != obj2.ecmaction) {
|
||||
elem2.options[key] = new Option(value.name, value.id);
|
||||
} else {
|
||||
elem2.options[key] = new Option(value.name, value.id, true, true);
|
||||
}
|
||||
});
|
||||
elem2.disabled = true;
|
||||
} else {
|
||||
elem2.disabled = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function updateSum(evt, rowIndex) {
|
||||
var listanetto = $('input[name^=tableEcmActions_ecmactioncost_display_]');
|
||||
var listabrutto = $('input[name^=tableEcmActions_costbrutto_display_]');
|
||||
var sumanetto = 0;
|
||||
var sumabrutto = 0;
|
||||
$.each(listanetto, function (key, value) {
|
||||
var tmp = $('#' + value.id);
|
||||
sumanetto = sumanetto + UnformatNumber(tmp.val());
|
||||
});
|
||||
$.each(listabrutto, function (key, value) {
|
||||
var tmp = $('#' + value.id);
|
||||
sumabrutto = sumabrutto + UnformatNumber(tmp.val());
|
||||
});
|
||||
$('#sum_netto').text(FormatNumber(sumanetto));
|
||||
$('#sum_brutto').text(FormatNumber(sumabrutto));
|
||||
}
|
||||
|
||||
function setDisabled(id) {
|
||||
var rekord = tabAction.appendGrid('getCellCtrl', 'code', id);
|
||||
var jr = $('#' + rekord.id + '');
|
||||
jr.attr("disabled", "disabled");
|
||||
rekord = tabAction.appendGrid('getCellCtrl', 'ecmproductname', id);
|
||||
jr = $('#' + rekord.id + '');
|
||||
jr.attr("disabled", "disabled");
|
||||
}
|
||||
|
||||
function showHideSingleCost(){
|
||||
var txt = $('#showPrice').val();
|
||||
if(txt == "Pokaż jednostkowe ceny"){
|
||||
$('#showPrice').val("Schowaj jednostkowe ceny");
|
||||
tabAction.appendGrid('showColumn', 'ecmactioncost_single_netto');
|
||||
tabAction.appendGrid('showColumn', 'ecmactioncost_single_brutto');
|
||||
}else{
|
||||
$('#showPrice').val("Pokaż jednostkowe ceny");
|
||||
tabAction.appendGrid('hideColumn', 'ecmactioncost_single_netto');
|
||||
tabAction.appendGrid('hideColumn', 'ecmactioncost_single_brutto');
|
||||
}
|
||||
}
|
||||
|
||||
function utf8_to_b64(str) {
|
||||
return window.btoa(unescape(encodeURIComponent(str)));
|
||||
}
|
||||
|
||||
function b64_to_utf8(str) {
|
||||
return decodeURIComponent(escape(window.atob(str)));
|
||||
}
|
||||
|
||||
function FormatNumber(number, precision) {
|
||||
var precision = precision || 2;
|
||||
// make string..
|
||||
number = number + '';
|
||||
number = number.replace(',', '.');
|
||||
// round
|
||||
number = toFixed(number, precision);
|
||||
// add 1000 sep
|
||||
var tmp = number.split(".");
|
||||
var c = '';
|
||||
for (var i = tmp[0].length; i != -1; i--) {
|
||||
c += tmp[0].charAt(i);
|
||||
if ((tmp[0].length - i) == 0 || i == 0)
|
||||
continue;
|
||||
if ((tmp[0].length - i) % 3 == 0)
|
||||
c += '.';
|
||||
}
|
||||
// reverse c
|
||||
c = c.split("").reverse().join("");
|
||||
return c + ',' + tmp[1];
|
||||
}
|
||||
|
||||
function toFixed(value, precision) {
|
||||
var precision = precision || 0,
|
||||
neg = value < 0, power = Math.pow(10, precision),
|
||||
value = Math.round(value * power),
|
||||
integral = String((neg ? Math.ceil : Math.floor)(value / power)),
|
||||
fraction = String((neg ? -value : value) % power),
|
||||
padding = new Array(Math.max(precision - fraction.length, 0) + 1).join('0');
|
||||
//fix problem with Math.floor and Math.ceil with result zero (lose sign)
|
||||
if (neg && integral=="0")
|
||||
integral='-'+integral;
|
||||
return precision ? integral + '.' + padding + fraction : integral;
|
||||
}
|
||||
|
||||
function UnformatNumber(number) {
|
||||
// make string..
|
||||
number = number + '';
|
||||
// remove 1000 sep
|
||||
number = number.replace(/\./g, '');
|
||||
// change ',' to '.'
|
||||
number = number.replace(',', '.');
|
||||
return parseFloat(number);
|
||||
}
|
||||
|
||||
function lockEnter() {
|
||||
// prevent default
|
||||
$(window).keydown(function (event) {
|
||||
if (event.keyCode == 13 && $(":focus").attr('id') != 'save_and_next') {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
75
modules/EcmWorkCards/language/en_us.lang.php
Normal file
75
modules/EcmWorkCards/language/en_us.lang.php
Normal 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',
|
||||
);
|
||||
79
modules/EcmWorkCards/language/pl_pl.lang.php
Normal file
79
modules/EcmWorkCards/language/pl_pl.lang.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?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',
|
||||
);
|
||||
53
modules/EcmWorkCards/metadata/SearchFields.php
Normal file
53
modules/EcmWorkCards/metadata/SearchFields.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".
|
||||
********************************************************************************/
|
||||
|
||||
$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
|
||||
);
|
||||
?>
|
||||
84
modules/EcmWorkCards/metadata/detailviewdefs.php
Normal file
84
modules/EcmWorkCards/metadata/detailviewdefs.php
Normal file
@@ -0,0 +1,84 @@
|
||||
<?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' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
1 => array(
|
||||
'label' => '10',
|
||||
'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(
|
||||
array(
|
||||
'name' => 'product_name',
|
||||
'label' => 'Produkt',
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'action_name',
|
||||
'label' => 'Czynność',
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'time',
|
||||
'label' => 'Czas od do',
|
||||
'customCode'=>'{$fields.time_from.value} - {$fields.time_to.value}'
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'quantity',
|
||||
'label' => 'Ilość',
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'description',
|
||||
'label' => 'Opis',
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
?>
|
||||
123
modules/EcmWorkCards/metadata/editviewdefs.php
Normal file
123
modules/EcmWorkCards/metadata/editviewdefs.php
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
$viewdefs ['EcmWorkCards'] ['EditView'] = array (
|
||||
'templateMeta' => array (
|
||||
'form' => array (
|
||||
'enctype' => 'multipart/form-data',
|
||||
'hidden' => array (
|
||||
'<input type="hidden" name="isSaveAndNew" value="false">',
|
||||
'<input type="hidden" id="create_new" name="create_new" value="0">'
|
||||
),
|
||||
'buttons' => array (
|
||||
'SAVE',
|
||||
'CANCEL',
|
||||
array (
|
||||
'customCode' => '<input tabindex="209" title="Zapisz [Alt+S]" accesskey="S" class="button primary" id="save_and_next" onclick="this.form.action.value=\'Save\';$(\'#create_new\').val(1);return check_form(\'EditView\');" name="button" value="Zapisz i dodaj nowy" type="submit">'
|
||||
)
|
||||
)
|
||||
),
|
||||
'maxColumns' => '2',
|
||||
'widths' => array (
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
)
|
||||
),
|
||||
'javascript' => '
|
||||
|
||||
<link class="theme" rel="stylesheet" href="include/jQuery/jquery-timepicker/jquery.timepicker.css">
|
||||
<script type="text/javascript" src="include/jQuery/jquery-timepicker/jquery.timepicker.min.js"></script>
|
||||
<script type="text/javascript" src="include/JSON.js?s={$SUGAR_VERSION}"></script>
|
||||
<script type="text/javascript" src="modules/EcmWorkCards/js/EditViewDocumentReady6.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',
|
||||
'displayParams' => array (
|
||||
'size' => 50
|
||||
)
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'date',
|
||||
'label' => 'LBL_DATE',
|
||||
'tabIndex' => '102'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'product_name',
|
||||
'customCode' => '<input size="50" id="product_name" type="txt" name="product_name" value="{$fields.product_name.value}"><input type="hidden" id="product_id" name="product_id" value="{$fields.product_id.value}">'
|
||||
)
|
||||
),
|
||||
|
||||
array (
|
||||
array (
|
||||
'name' => 'action_name',
|
||||
|
||||
'customCode' => '<input size="50" id="action_name" type="txt" name="action_name" value="{$fields.action_name.value}"><input type="hidden" id="action_id" name="action_id" value="{$fields.action_id.value}">'
|
||||
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'time_from',
|
||||
'label' => "Czas od do",
|
||||
'customCode' => '<input type="text" tabindex="105" id="time_from" name="time_from" value="{$fields.time_from.value}"> - <input tabindex="106" type="text" id="time_to" name="time_to" value="{$fields.time_to.value}">'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'quantity',
|
||||
'label' => 'Ilość',
|
||||
'customCode' => '<input type="text" onchange="$(this).val(FormatNumber($(this).val()));" onclick="$(this).select();" tabindex="107" id="quantity" name="quantity" value="{$fields.quantity.value|number_format:2:",":"."}">'
|
||||
)
|
||||
),
|
||||
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'}"
|
||||
* )
|
||||
* )
|
||||
* )
|
||||
*/
|
||||
)
|
||||
);
|
||||
?>
|
||||
59
modules/EcmWorkCards/metadata/listviewdefs.php
Normal file
59
modules/EcmWorkCards/metadata/listviewdefs.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?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' => '1',
|
||||
'default' => true,
|
||||
'align' => 'right',
|
||||
),
|
||||
'WORKER_NAME' => array (
|
||||
'type' => 'varchar',
|
||||
'label' => 'LBL_WORKER_NAME',
|
||||
'width' => '5',
|
||||
'default' => true,
|
||||
'align' => 'left',
|
||||
),
|
||||
'PRODUCT_NAME' => array (
|
||||
'label' => 'Produkt',
|
||||
'width' => '5',
|
||||
'default' => true,
|
||||
'sortable'=>false,
|
||||
'align' => 'left',
|
||||
),
|
||||
'ACTION_NAME' => array (
|
||||
'label' => 'Czynność',
|
||||
'link' => false,
|
||||
'width' => '5',
|
||||
'default' => true,
|
||||
'sortable'=>false,
|
||||
'align' => 'left',
|
||||
),
|
||||
'TIME_FROM' => array (
|
||||
'label' => 'Czas od do',
|
||||
'width' => '5',
|
||||
'default' => true,
|
||||
'sortable'=>false,
|
||||
'align' => 'left',
|
||||
),
|
||||
'QUANTITY' => array(
|
||||
'width' => '5',
|
||||
'label' => 'Ilość',
|
||||
'align' => 'right',
|
||||
'default' => true,
|
||||
),
|
||||
|
||||
'DESCRIPTION' => array (
|
||||
'label' => 'Opis',
|
||||
'link' => false,
|
||||
'width' => '10',
|
||||
'sortable'=>false,
|
||||
'default' => true,
|
||||
'align' => 'left',
|
||||
),
|
||||
|
||||
);
|
||||
?>
|
||||
67
modules/EcmWorkCards/metadata/popupdefs.php
Normal file
67
modules/EcmWorkCards/metadata/popupdefs.php
Normal 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,
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
56
modules/EcmWorkCards/metadata/quickcreatedefs.php
Normal file
56
modules/EcmWorkCards/metadata/quickcreatedefs.php
Normal 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',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
38
modules/EcmWorkCards/metadata/searchdefs.php
Normal file
38
modules/EcmWorkCards/metadata/searchdefs.php
Normal 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'
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
41
modules/EcmWorkCards/metadata/studio.php
Normal file
41
modules/EcmWorkCards/metadata/studio.php
Normal 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
|
||||
*/
|
||||
|
||||
?>
|
||||
55
modules/EcmWorkCards/metadata/subpaneldefs.php
Normal file
55
modules/EcmWorkCards/metadata/subpaneldefs.php
Normal 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'),
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
72
modules/EcmWorkCards/metadata/subpanels/default.php
Normal file
72
modules/EcmWorkCards/metadata/subpanels/default.php
Normal 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%',
|
||||
),
|
||||
),
|
||||
);
|
||||
?>
|
||||
20
modules/EcmWorkCards/tpl/DetailViewTableEcmActions.tpl
Normal file
20
modules/EcmWorkCards/tpl/DetailViewTableEcmActions.tpl
Normal file
@@ -0,0 +1,20 @@
|
||||
<input type="hidden" name="tableEcmActions_list" id="tableEcmActions_list" value='{$TABLEECMACTIONS_LIST|@json_encode}'>
|
||||
<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;overflow:auto;">
|
||||
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
|
||||
<table id="tableEcmActions" style="width: 100%" class="positions">
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
<input type="button" id="showPrice" name="showPrice" value="Pokaż jednostkowe ceny" onclick="showHideSingleCost()">
|
||||
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;overflow:auto;float: right">
|
||||
<table class="positions">
|
||||
<tr>
|
||||
<td>Suma netto</td>
|
||||
<td id="sum_netto" style="text-align: right">0,00</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suma brutto</td>
|
||||
<td id="sum_brutto" style="text-align: right">0,00</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
22
modules/EcmWorkCards/tpl/EditViewTableEcmActions.tpl
Normal file
22
modules/EcmWorkCards/tpl/EditViewTableEcmActions.tpl
Normal file
@@ -0,0 +1,22 @@
|
||||
<input type="hidden" name="tableEcmActions_list" id="tableEcmActions_list" value='{$TABLEECMACTIONS_LIST|@json_encode}'>
|
||||
|
||||
<script src="include/ECM/tablenavigator.js"></script>
|
||||
<div style="width:100%;border: 1px solid rgb(48,192,255);background-color:white;overflow:auto;">
|
||||
<link rel="stylesheet" type="text/css" href="modules/Accounts/MyTable.css" />
|
||||
<table id="tableEcmActions" style="width: 100%" class="positions" name="tableEcmActions">
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
<input type="button" id="showPrice" name="showPrice" value="Pokaż jednostkowe ceny" onclick="showHideSingleCost()">
|
||||
<div style="width:30%;border: 1px solid rgb(48,192,255);background-color:white;overflow:auto;float: right">
|
||||
<table class="positions">
|
||||
<tr>
|
||||
<td>Suma netto</td>
|
||||
<td id="sum_netto" style="text-align: right">0,00</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Suma brutto</td>
|
||||
<td id="sum_brutto" style="text-align: right">0,00</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
177
modules/EcmWorkCards/vardefs.php
Normal file
177
modules/EcmWorkCards/vardefs.php
Normal file
@@ -0,0 +1,177 @@
|
||||
<?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' => true,
|
||||
),
|
||||
'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' => true,
|
||||
),
|
||||
'product_id' => array(
|
||||
'name' => 'product_id',
|
||||
'type' => 'varchar',
|
||||
'len' => '46',
|
||||
'vname' => 'Produkt'
|
||||
),
|
||||
'product_name' => array(
|
||||
'name' => 'product_name',
|
||||
'type' => 'relate',
|
||||
'id_name' => 'product_id',
|
||||
'module' => 'EcmProducts',
|
||||
'len' => '255',
|
||||
'vname' => 'Produkt',
|
||||
'source' => 'non-db',
|
||||
'rname' => 'code',
|
||||
'required' => true,
|
||||
),
|
||||
'action_id' => array(
|
||||
'name' => 'action_id',
|
||||
'type' => 'varchar',
|
||||
'len' => '45',
|
||||
'vname' => 'Czynność'
|
||||
),
|
||||
'action_name' => array(
|
||||
'name' => 'action_name',
|
||||
'type' => 'relate',
|
||||
'id_name' => 'action_id',
|
||||
'module' => 'EcmActions',
|
||||
'len' => '255',
|
||||
'vname' => 'Czynność',
|
||||
'source' => 'non-db',
|
||||
'rname' => 'name',
|
||||
'required' => false,
|
||||
),
|
||||
'date' => array(
|
||||
'required' => false,
|
||||
'name' => 'date',
|
||||
'vname' => 'LBL_DATE',
|
||||
'type' => 'date',
|
||||
'default' => 'now',
|
||||
'massupdate' => 0,
|
||||
'no_default' => false,
|
||||
'audited' => true,
|
||||
),
|
||||
'quantity' => array(
|
||||
'name' => 'quantity',
|
||||
'dbtype' => 'decimal',
|
||||
'label'=>'Ilość',
|
||||
'len' => '14,2',
|
||||
'required' => false,
|
||||
),
|
||||
'time_from' => array(
|
||||
'name' => 'time_from',
|
||||
'dbtype' => 'varchar',
|
||||
'len' => '255',
|
||||
'required' => true,
|
||||
),
|
||||
'time_to' => array(
|
||||
'name' => 'time_to',
|
||||
'dbtype' => 'varchar',
|
||||
'len' => '255',
|
||||
'required' => true,
|
||||
),
|
||||
'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'
|
||||
));
|
||||
170
modules/EcmWorkCards/view/DetailView/DetailView.tpl
Normal file
170
modules/EcmWorkCards/view/DetailView/DetailView.tpl
Normal file
@@ -0,0 +1,170 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
{{include file="modules/EcmInvoiceOuts/view/DetailView/header.tpl"}}
|
||||
{sugar_include include=$includes}
|
||||
{{* Render tag for VCR control if SHOW_VCR_CONTROL is true *}}
|
||||
{{if $SHOW_VCR_CONTROL}}
|
||||
<table width='100%' border='0' style="border-bottom:0px;" cellspacing='{$gridline}' cellpadding='0' class='tabDetailView'>
|
||||
{$PAGINATION}
|
||||
</table>
|
||||
{{/if}}
|
||||
{literal}
|
||||
<script language="javascript">
|
||||
var SelectedTab = "";
|
||||
function SetTab(tab_name) {
|
||||
var TabMenu = document.getElementById('groupTabsPanels');
|
||||
var tabs = TabMenu.getElementsByTagName('li');
|
||||
for (i = 0; i < tabs.length; i++) {
|
||||
if ((tab_name + '_menu') === tabs[i].id) {
|
||||
tabs[i].className = 'active';
|
||||
tabs[i].getElementsByTagName('a')[0].className = 'current';
|
||||
} else {
|
||||
tabs[i].className = '';
|
||||
tabs[i].getElementsByTagName('a')[0].className = '';
|
||||
}
|
||||
}
|
||||
var prev = document.getElementById(SelectedTab);
|
||||
var curr = document.getElementById(tab_name);
|
||||
prev.style.display = 'none';
|
||||
curr.style.display = '';
|
||||
SelectedTab = tab_name;
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
<ul class="subpanelTablist" style="margin-top:10px;" id="groupTabsPanels">
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
{{if $panel[0][0].field.type == 'tab'}}
|
||||
{{if $label=='EMAIL'}}
|
||||
{{else}}
|
||||
<li class="{{if $panel[0][0].field.active}}active{{/if}}" id="panel_{{$label}}_menu">
|
||||
<script language="javascript">
|
||||
var set{{$label}} = function () {literal} {
|
||||
{/literal} SetTab('panel_{{$label}}');
|
||||
{literal} };{/literal}
|
||||
{{if $panel[0][0].field.active}}SelectedTab = "panel_{{$label}}";{{/if}}
|
||||
</script>
|
||||
<a class="{{if $panel[0][0].field.active}}current{{else}}other{{/if}}" href="javascript:set{{$label}}();">{sugar_translate label='LBL_{{$label}}_TAB' module='{{$module}}'}</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
<li class="" id="panel_EMAIL_menu">
|
||||
<a class="" href="javascript:{$EMAIL_LINK}">{sugar_translate label='LBL_EMAIL_TAB' module='EcmQuotes'}</a>
|
||||
</li>
|
||||
</ul>
|
||||
{{* Loop through all top level panels first *}}
|
||||
{{counter name="panelCount" print=false start=0 assign="panelCount"}}
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
{{assign var='panel_id' value=$panelCount}}
|
||||
<div {{if $panel[0][0].field.active == false}}style="display:none"{{/if}} id='panel_{{$label}}'>
|
||||
{counter name="panelFieldCount" start=0 print=false assign="panelFieldCount"}
|
||||
{{* Print out the panel title if one exists*}}
|
||||
{{* Check to see if the panel variable is an array, if not, we'll attempt an include with type param php *}}
|
||||
{{* See function.sugar_include.php *}}
|
||||
{{if !is_array($panel)}}
|
||||
{sugar_include type='php' file='{{$panel}}'}
|
||||
{{else}}
|
||||
<!--
|
||||
{{if !empty($label) && !is_int($label) && $label != 'DEFAULT'}}
|
||||
<h4 class="dataLabel">{sugar_translate label='{{$label}}' module='{{$module}}'}</h4><br>
|
||||
{{/if}}
|
||||
-->
|
||||
{{* Print out the table data *}}
|
||||
<table width='100%' border='0' style="border-top:0px" cellspacing='{$gridline}' cellpadding='0' class='tabDetailView'>
|
||||
{{if $panelCount == 0}}
|
||||
{{counter name="panelCount" print=false}}
|
||||
{{/if}}
|
||||
{{foreach name=rowIteration from=$panel key=row item=rowData}}
|
||||
<tr>
|
||||
{{assign var='columnsInRow' value=$rowData|@count}}
|
||||
{{assign var='columnsUsed' value=0}}
|
||||
{{foreach name=colIteration from=$rowData key=col item=colData}}
|
||||
{{if $colData.field.allCols == false}}
|
||||
<td width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].label}}%' class='tabDetailViewDL' NOWRAP>
|
||||
{{if isset($colData.field.customLabel)}}
|
||||
{{$colData.field.customLabel}}
|
||||
{{elseif isset($colData.field.label) && strpos($colData.field.label, '$')}}
|
||||
{capture name="label" assign="label"}
|
||||
{{$colData.field.label}}
|
||||
{/capture}
|
||||
{$label|strip_semicolon}:
|
||||
{{elseif isset($colData.field.label)}}
|
||||
{capture name="label" assign="label"}
|
||||
{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}
|
||||
{/capture}
|
||||
{$label|strip_semicolon}:
|
||||
{{elseif isset($fields[$colData.field.name])}}
|
||||
{capture name="label" assign="label"}
|
||||
{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}
|
||||
{/capture}
|
||||
{$label|strip_semicolon}:
|
||||
{{else}}
|
||||
|
||||
{{/if}}
|
||||
</td>
|
||||
{{/if}}
|
||||
<td width='{{if $colData.field.allCols == true}}100{{else}}{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].field}}{{/if}}%' class='tabDetailViewDF' {{if $colData.field.allCols == true}}colspan='4'{{else}}{{if $colData.colspan}}colspan='{{$colData.colspan}}'{{/if}}{{/if}}>
|
||||
{{if $colData.field.customCode || $colData.field.assign}}
|
||||
{counter name="panelFieldCount"}
|
||||
{{sugar_evalcolumn var=$colData.field colData=$colData}}
|
||||
{{elseif $fields[$colData.field.name] && !empty($colData.field.fields) }}
|
||||
{{foreach from=$colData.field.fields item=subField}}
|
||||
{{if $fields[$subField]}}
|
||||
{counter name="panelFieldCount"}
|
||||
{{sugar_field parentFieldArray='fields' tabindex=$tabIndex vardef=$fields[$subField] displayType='detailView'}}
|
||||
{{else}}
|
||||
{counter name="panelFieldCount"}
|
||||
{{$subField}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{elseif $fields[$colData.field.name]}}
|
||||
{counter name="panelFieldCount"}
|
||||
{{sugar_field parentFieldArray='fields' vardef=$fields[$colData.field.name] displayType='detailView' displayParams=$colData.field.displayParams typeOverride=$colData.field.type}}
|
||||
{{/if}}
|
||||
|
||||
</td>
|
||||
{{/foreach}}
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
</table>
|
||||
{{/if}}
|
||||
</div>
|
||||
{if $panelFieldCount == 0}
|
||||
<script>document.getElementById("panel_{{$panel_id}}").style.display = 'none';</script>
|
||||
{/if}
|
||||
{{/foreach}}
|
||||
{{include file="modules/EcmInvoiceOuts/view/DetailView/footer.tpl"}}
|
||||
37
modules/EcmWorkCards/view/DetailView/footer.tpl
Normal file
37
modules/EcmWorkCards/view/DetailView/footer.tpl
Normal file
@@ -0,0 +1,37 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
</form>
|
||||
106
modules/EcmWorkCards/view/DetailView/header.tpl
Normal file
106
modules/EcmWorkCards/view/DetailView/header.tpl
Normal file
@@ -0,0 +1,106 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
{{* Add the preForm code if it is defined (used for vcards) *}}
|
||||
{{if $preForm}}
|
||||
{{$preForm}}
|
||||
{{/if}}
|
||||
<table cellpadding="1" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px;" align="left" NOWRAP>
|
||||
<form action="index.php" method="post" name="DetailView" id="form">
|
||||
<input type="hidden" name="module" value="{$module}">
|
||||
<input type="hidden" name="record" value="{$fields.id.value}">
|
||||
<input type="hidden" name="return_action">
|
||||
<input type="hidden" name="return_module">
|
||||
<input type="hidden" name="return_id">
|
||||
<input type="hidden" name="isDuplicate" value="false">
|
||||
<input type="hidden" name="offset" value="{$offset}">
|
||||
<input type="hidden" name="action" value="EditView">
|
||||
{{if isset($form.hidden)}}
|
||||
{{foreach from=$form.hidden item=field}}
|
||||
{{$field}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
|
||||
{{if !isset($form.buttons)}}
|
||||
<input title="{$APP.LBL_EDIT_BUTTON_TITLE}" accessKey="{$APP.LBL_EDIT_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='{$module}'; this.form.return_action.value='DetailView'; this.form.return_id.value='{$id}'; this.form.action.value='EditView'" type="submit" name="Edit" id='edit_button' value=" {$APP.LBL_EDIT_BUTTON_LABEL} ">
|
||||
<input title="{$APP.LBL_DUPLICATE_BUTTON_TITLE}" accessKey="{$APP.LBL_DUPLICATE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='{$module}'; this.form.return_action.value='index'; this.form.isDuplicate.value=true; this.form.action.value='EditView'" type="submit" name="Duplicate" value=" {$APP.LBL_DUPLICATE_BUTTON_LABEL} " id='duplicate_button'>
|
||||
<input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" onclick="this.form.return_module.value='{$module}'; this.form.return_action.value='ListView'; this.form.action.value='Delete'; return confirm('{$APP.NTC_DELETE_CONFIRMATION}')" type="submit" name="Delete" value="cos" style="{$DELETED}">
|
||||
|
||||
{{else}}
|
||||
{{counter assign="num_buttons" start=0 print=false}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{if !is_array($button) && in_array($button, $built_in_buttons)}}
|
||||
{{counter print=false}}
|
||||
{{sugar_button module="$module" id="$button" view="EditView"}}
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{if isset($closeFormBeforeCustomButtons)}}
|
||||
</form>
|
||||
</td>
|
||||
{{/if}}
|
||||
{{if count($form.buttons) > $num_buttons}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{if is_array($button) && $button.customCode}}
|
||||
<td style="padding-bottom: 2px;" align="left" NOWRAP>
|
||||
{{sugar_button module="$module" id="$button" view="EditView"}}
|
||||
</td>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{if !isset($closeFormBeforeCustomButtons)}}
|
||||
</form>
|
||||
</td>
|
||||
{{/if}}
|
||||
{{if empty($form.hideAudit) || !$form.hideAudit}}
|
||||
<td style="padding-bottom: 2px;" align="left" NOWRAP>
|
||||
{{sugar_button module="$module" id="Audit" view="EditView"}}
|
||||
</td>
|
||||
{{/if}}
|
||||
<td align="right" width="100%">{$ADMIN_EDIT}</td>
|
||||
{{* Add $form.links if they are defined *}}
|
||||
{{if !empty($form) && isset($form.links)}}
|
||||
<td align="right" width="10%"> </td>
|
||||
<td align="right" width="100%" NOWRAP>
|
||||
{{foreach from=$form.links item=link}}
|
||||
{{$link}}
|
||||
{{/foreach}}
|
||||
</td>
|
||||
{{/if}}
|
||||
</tr>
|
||||
</table>
|
||||
95
modules/EcmWorkCards/view/DetailView/view.detail.my.php
Normal file
95
modules/EcmWorkCards/view/DetailView/view.detail.my.php
Normal 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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
421
modules/EcmWorkCards/view/EditView/EditView.tpl
Normal file
421
modules/EcmWorkCards/view/EditView/EditView.tpl
Normal file
@@ -0,0 +1,421 @@
|
||||
{*
|
||||
|
||||
/*********************************************************************************
|
||||
|
||||
* 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".
|
||||
|
||||
********************************************************************************/
|
||||
|
||||
*}
|
||||
|
||||
|
||||
|
||||
{literal}
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.dataLabel { padding: 2px; }
|
||||
|
||||
.dataField { padding: 2px; }
|
||||
|
||||
.tabEditViewDF { padding: 2px; }
|
||||
|
||||
td .dataLabel { padding: 2px; }
|
||||
|
||||
td .dataField { padding: 2px; }
|
||||
|
||||
td .tabEditViewDF { padding: 2px; }
|
||||
|
||||
.tabForm { border-top:none; }
|
||||
|
||||
</style>
|
||||
|
||||
{/literal}
|
||||
|
||||
|
||||
|
||||
{{include file='modules/EcmInvoiceOuts/view/EditView/header.tpl'}}
|
||||
|
||||
{sugar_include include=$includes}
|
||||
|
||||
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" class='tabDetailView' id='tabFormPagination'>
|
||||
|
||||
{{if $panelCount == 0}}
|
||||
|
||||
{{* Render tag for VCR control if SHOW_VCR_CONTROL is true *}}
|
||||
|
||||
{{if $SHOW_VCR_CONTROL}}
|
||||
|
||||
{$PAGINATION}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
{literal}
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
var SelectedTab = "";
|
||||
|
||||
function SetTab(tab_name) {
|
||||
|
||||
var TabMenu = document.getElementById('groupTabs');
|
||||
|
||||
var tabs = TabMenu.getElementsByTagName('li');
|
||||
|
||||
for(i=0;i<tabs.length;i++) {
|
||||
|
||||
if((tab_name+'_menu') === tabs[i].id) {
|
||||
|
||||
tabs[i].className = 'active';
|
||||
|
||||
tabs[i].getElementsByTagName('a')[0].className = 'current';
|
||||
|
||||
} else {
|
||||
|
||||
tabs[i].className = '';
|
||||
|
||||
tabs[i].getElementsByTagName('a')[0].className = '';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var prev = document.getElementById(SelectedTab);
|
||||
|
||||
var curr = document.getElementById(tab_name);
|
||||
|
||||
prev.style.display = 'none';
|
||||
|
||||
curr.style.display = '';
|
||||
|
||||
SelectedTab = tab_name;
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{/literal}
|
||||
|
||||
|
||||
|
||||
<ul class="tabList" style="margin-top:10px;" id="groupTabs">
|
||||
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
|
||||
{{if $panel[0][0].field.type == 'tab'}}
|
||||
|
||||
<li class="{{if $panel[0][0].field.active}}active{{/if}}" id="{{$label}}_menu">
|
||||
|
||||
<script language="javascript">
|
||||
|
||||
var set{{$label}} = function() {literal} { {/literal} SetTab('{{$label}}'); {literal} }; {/literal}
|
||||
|
||||
{{if $panel[0][0].field.active}}SelectedTab="{{$label}}";{{/if}}
|
||||
|
||||
</script>
|
||||
|
||||
<a class="{{if $panel[0][0].field.active}}current{{/if}}" href="javascript:set{{$label}}();">{sugar_translate label='LBL_{{$label}}_TAB' module='{{$module}}'}</a>
|
||||
|
||||
</li>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
{{* Loop through all top level panels first *}}
|
||||
|
||||
{{counter name="panelCount" start=-1 print=false assign="panelCount"}}
|
||||
|
||||
|
||||
|
||||
{{foreach name=section from=$sectionPanels key=label item=panel}}
|
||||
|
||||
{{counter name="panelCount" print=false}}
|
||||
|
||||
|
||||
|
||||
{{* Print out the table data *}}
|
||||
|
||||
<div id="{{$label}}" style="display:{{if !$panel[0][0].field.active}}none{{/if}};">
|
||||
|
||||
{counter name="panelFieldCount" start=0 print=false assign="panelFieldCount"}
|
||||
|
||||
{{* Check to see if the panel variable is an array, if not, we'll attempt an include with type param php *}}
|
||||
|
||||
{{* See function.sugar_include.php *}}
|
||||
|
||||
{{if !is_array($panel)}}
|
||||
|
||||
{sugar_include type='php' file='{{$panel}}'}
|
||||
|
||||
{{else}}
|
||||
|
||||
|
||||
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="{$def.templateMeta.panelClass|default:tabForm}">
|
||||
|
||||
{{* Only show header if it is not default or an int value *}}
|
||||
|
||||
{{if !empty($label) && !is_int($label) && $label != 'DEFAULT'}}
|
||||
|
||||
<th class="dataLabel" align="left" colspan="8">
|
||||
|
||||
<h4>{sugar_translate label='LBL_{{$label}}' module='{{$module}}'}</h4>
|
||||
|
||||
</th>
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{assign var='rowCount' value=0}}
|
||||
|
||||
{{foreach name=rowIteration from=$panel key=row item=rowData}}
|
||||
|
||||
<tr>
|
||||
|
||||
|
||||
|
||||
{{assign var='columnsInRow' value=$rowData|@count}}
|
||||
|
||||
{{assign var='columnsUsed' value=0}}
|
||||
|
||||
|
||||
|
||||
{{* Loop through each column and display *}}
|
||||
|
||||
{{counter name="colCount" start=0 print=false assign="colCount"}}
|
||||
|
||||
|
||||
|
||||
{{foreach name=colIteration from=$rowData key=col item=colData}}
|
||||
|
||||
{{counter name="colCount" print=false}}
|
||||
|
||||
{{math assign="tabIndex" equation="$panelCount * $maxColumns + $colCount"}}
|
||||
|
||||
{{if count($rowData) == $colCount}}
|
||||
|
||||
{{assign var="colCount" value=0}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{if empty($def.templateMeta.labelsOnTop) && empty($colData.field.hideLabel)}}
|
||||
|
||||
<td valign="top" width='{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].label}}%' class="dataLabel" NOWRAP>
|
||||
|
||||
{{if isset($colData.field.customLabel)}}
|
||||
|
||||
{{$colData.field.customLabel}}
|
||||
|
||||
{{elseif isset($colData.field.label)}}
|
||||
|
||||
{capture name="label" assign="label}
|
||||
|
||||
{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{elseif isset($fields[$colData.field.name])}}
|
||||
|
||||
{capture name="label" assign="label}
|
||||
|
||||
{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{$label|strip_semicolon}:
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{* Show the required symbol if field is required, but override not set. Or show if override is set *}}
|
||||
|
||||
{{if ($fields[$colData.field.name].required && (!isset($colData.field.displayParams.required) || $colData.field.displayParams.required)) ||
|
||||
|
||||
(isset($colData.field.displayParams.required) && $colData.field.displayParams.required)}}
|
||||
|
||||
<span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
|
||||
|
||||
{{/if}}
|
||||
|
||||
</td>
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
<td valign="top" width='{{if $colData.field.allCols}}100%{{else}}{{$def.templateMeta.widths[$smarty.foreach.colIteration.index].field}}{{/if}}%' class='tabEditViewDF' {{if $colData.field.allCols}}colspan='8'{{else}}{{if $colData.colspan}}colspan='{{$colData.colspan}}'{{/if}}{{/if}} NOWRAP>
|
||||
|
||||
{{if !empty($def.templateMeta.labelsOnTop)}}
|
||||
|
||||
{{if isset($colData.field.label)}}
|
||||
|
||||
{{if !empty($colData.field.label)}}
|
||||
|
||||
{sugar_translate label='{{$colData.field.label}}' module='{{$module}}'}:
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{elseif isset($fields[$colData.field.name])}}
|
||||
|
||||
{sugar_translate label='{{$fields[$colData.field.name].vname}}' module='{{$module}}'}:
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{* Show the required symbol if field is required, but override not set. Or show if override is set *}}
|
||||
|
||||
{{if ($fields[$colData.field.name].required && (!isset($colData.field.displayParams.required) || $colData.field.displayParams.required)) ||
|
||||
|
||||
(isset($colData.field.displayParams.required) && $colData.field.displayParams.required)}}
|
||||
|
||||
<span class="required">{{$APP.LBL_REQUIRED_SYMBOL}}</span>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{if !isset($colData.field.label) || !empty($colData.field.label)}}
|
||||
|
||||
<br>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{if $fields[$colData.field.name] && !empty($colData.field.fields) }}
|
||||
|
||||
{{foreach from=$colData.field.fields item=subField}}
|
||||
|
||||
{{if $fields[$subField.name]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' tabindex=$colData.field.tabindex vardef=$fields[$subField.name] displayType='editView' displayParams=$subField.displayParams formName=$form_name}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
{{elseif !empty($colData.field.customCode)}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{sugar_evalcolumn var=$colData.field.customCode colData=$colData tabindex=$colData.field.tabindex}}
|
||||
|
||||
{{elseif $fields[$colData.field.name]}}
|
||||
|
||||
{counter name="panelFieldCount"}
|
||||
|
||||
{{$colData.displayParams}}
|
||||
|
||||
{{sugar_field parentFieldArray='fields' tabindex=$colData.field.tabindex vardef=$fields[$colData.field.name] displayType='editView' displayParams=$colData.field.displayParams typeOverride=$colData.field.type formName=$form_name}}
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
</tr>
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
{{/if}}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{if $panelFieldCount == 0}
|
||||
|
||||
<script>document.getElementById("{{$label}}").style.display='none';</script>
|
||||
|
||||
{/if}
|
||||
|
||||
{{/foreach}}
|
||||
|
||||
{{include file='modules/EcmInvoiceOuts/view/EditView/footer.tpl'}}
|
||||
61
modules/EcmWorkCards/view/EditView/footer.tpl
Normal file
61
modules/EcmWorkCards/view/EditView/footer.tpl
Normal file
@@ -0,0 +1,61 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
{{if empty($form.button_location) || $form.button_location == 'bottom'}}
|
||||
<div style="padding-top: 2px">
|
||||
{{if !empty($form) && !empty($form.buttons)}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{sugar_button module="$module" id="$button" view="$view"}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{sugar_button module="$module" id="SAVE" view="$view"}}
|
||||
{{sugar_button module="$module" id="CANCEL" view="$view"}}
|
||||
{{/if}}
|
||||
{{sugar_button module="$module" id="Audit" view="$view"}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</form>
|
||||
{{if $externalJSFile}}
|
||||
require_once("'".$externalJSFile."'");
|
||||
{{/if}}
|
||||
|
||||
{$set_focus_block}
|
||||
|
||||
{{if isset($scriptBlocks)}}
|
||||
<!-- Begin Meta-Data Javascript -->
|
||||
{{$scriptBlocks}}
|
||||
<!-- End Meta-Data Javascript -->
|
||||
{{/if}}
|
||||
79
modules/EcmWorkCards/view/EditView/header.tpl
Normal file
79
modules/EcmWorkCards/view/EditView/header.tpl
Normal file
@@ -0,0 +1,79 @@
|
||||
{*
|
||||
/*********************************************************************************
|
||||
* 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".
|
||||
********************************************************************************/
|
||||
*}
|
||||
<form action="index.php" method="POST" name="{$form_name}" id="{$form_id}" {$enctype}>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px;">
|
||||
<input type="hidden" name="module" value="{$module}">
|
||||
{if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}
|
||||
<input type="hidden" name="record" value="">
|
||||
{else}
|
||||
<input type="hidden" name="record" value="{$fields.id.value}">
|
||||
{/if}
|
||||
<input type="hidden" name="isDuplicate" value="false">
|
||||
<input type="hidden" name="action">
|
||||
<input type="hidden" name="return_module" value="{$smarty.request.return_module}">
|
||||
<input type="hidden" name="return_action" value="{$smarty.request.return_action}">
|
||||
<input type="hidden" name="return_id" value="{$smarty.request.return_id}">
|
||||
<input type="hidden" name="contact_role">
|
||||
{if !empty($smarty.request.return_module)}
|
||||
<input type="hidden" name="relate_to" value="{$smarty.request.return_module}">
|
||||
<input type="hidden" name="relate_id" value="{$smarty.request.return_id}">
|
||||
{/if}
|
||||
<input type="hidden" name="offset" value="{$offset}">
|
||||
{{if isset($form.hidden)}}
|
||||
{{foreach from=$form.hidden item=field}}
|
||||
{{$field}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{if empty($form.button_location) || $form.button_location == 'top'}}
|
||||
{{if !empty($form) && !empty($form.buttons)}}
|
||||
{{foreach from=$form.buttons key=val item=button}}
|
||||
{{sugar_button module="$module" id="$button" view="$view"}}
|
||||
{{/foreach}}
|
||||
{{else}}
|
||||
{{sugar_button module="$module" id="SAVE" view="$view"}}
|
||||
{{sugar_button module="$module" id="CANCEL" view="$view"}}
|
||||
{{/if}}
|
||||
{{if empty($form.hideAudit) || !$form.hideAudit}}
|
||||
{{sugar_button module="$module" id="Audit" view="$view"}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td align='right'>{{$ADMIN_EDIT}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
186
modules/EcmWorkCards/view/EditView/view.edit.my.php
Normal file
186
modules/EcmWorkCards/view/EditView/view.edit.my.php
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user