Merge remote-tracking branch 'origin/3.7' into develop

Conflicts:
	htdocs/projet/tasks/task.php
This commit is contained in:
Laurent Destailleur 2014-12-04 14:52:34 +01:00
commit 6729544782
53 changed files with 366 additions and 259 deletions

View File

@ -82,8 +82,9 @@ For users:
- New: Add dunning into accountancy report.
- New: Add favorite button into country dictionary to put value on top select list
- Upgrade phpexcel lib to 1.7.8
- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export
- New : Option on extrafields to have them always editable regardless of the document status
- New : Use of MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR to use disk cache for big excel export.
- New : Option on extrafields to have them always editable regardless of the document status.
- New : New module PrintIPP to print without opening document is available as stable.
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
- Fix: [ bug #1470, #1472, #1473] User trigger problem
- Fix: [ bug #1489, #1491 ] Intervention trigger problem

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -26,7 +26,7 @@
*/
require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@ -43,7 +43,7 @@ if ($user->societe_id > 0)
accessforbidden();
if (! $user->rights->accounting->ventilation->read)
accessforbidden();
// Filter
$year = $_GET["year"];
if ($year == 0) {
@ -57,10 +57,10 @@ if ($year == 0) {
// Validate History
$action = GETPOST('action');
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fd.fk_code_ventilation = accnt.rowid";
@ -75,8 +75,7 @@ if ($action == 'validatehistory') {
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0";
}
dol_syslog("/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
@ -106,7 +105,6 @@ $sql .= " , " . MAIN_DB_PREFIX . "facture as f";
$sql .= " WHERE fd.fk_code_ventilation = 0";
$sql .= " AND f.rowid = fd.fk_facture AND f.fk_statut = 1;";
dol_syslog("/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$row = $db->fetch_row($result);
@ -162,15 +160,14 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " GROUP BY fd.fk_code_ventilation";
dol_syslog("/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$i = 0;
$num = $db->num_rows($resql);
while ( $i < $num ) {
$row = $db->fetch_row($resql);
print '<tr><td>' . length_accountg($row[0]) . '</td>';
print '<td align="left">' . $row[1] . '</td>';
print '<td align="right">' . price($row[2]) . '</td>';
@ -235,15 +232,14 @@ if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
dol_syslog('accountancy/customer/index.php:: $sql=' . $sql);
$resql = $db->query($sql);
if ($resql) {
$i = 0;
$num = $db->num_rows($resql);
while ( $i < $num ) {
$row = $db->fetch_row($resql);
print '<tr><td>' . $row[0] . '</td>';
print '<td align="right">' . price($row[1]) . '</td>';
print '<td align="right">' . price($row[2]) . '</td>';
@ -284,7 +280,7 @@ if (! empty($conf->margin->enabled)) {
print '<td width="60" align="center">' . $langs->trans("NovemberMin") . '</td>';
print '<td width="60" align="center">' . $langs->trans("DecemberMin") . '</td>';
print '<td width="60" align="center"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT '" . $langs->trans("Vide") . "' AS 'Marge',";
$sql .= " ROUND(SUM(IF(MONTH(f.datef)=1,(fd.total_ht-(fd.qty * fd.buy_price_ht)),0)),2) AS 'Janvier',";
$sql .= " ROUND(SUM(IF(MONTH(f.datef)=2,(fd.total_ht-(fd.qty * fd.buy_price_ht)),0)),2) AS 'Fevrier',";
@ -303,20 +299,19 @@ if (! empty($conf->margin->enabled)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
if (! empty($conf->multicompany->enabled)) {
$sql .= " AND f.entity = '" . $conf->entity . "'";
}
dol_syslog('accountancy/customer/index.php:: $sql=' . $sql);
$resql = $db->query($sql);
if ($resql) {
$i = 0;
$num = $db->num_rows($resql);
while ( $i < $num ) {
$row = $db->fetch_row($resql);
print '<tr><td>' . $row[0] . '</td>';
print '<td align="right">' . price($row[1]) . '</td>';
print '<td align="right">' . price($row[2]) . '</td>';

View File

@ -249,7 +249,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup');
print '<br>';
$head = order_admin_prepare_head(null);
$head = order_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Orders"), 0, 'order');

View File

@ -296,7 +296,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("BillsSetup"),$linkback,'setup');
print '<br>';
$head = invoice_admin_prepare_head(null);
$head = invoice_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Invoices"), 0, 'invoice');
/*

View File

@ -158,7 +158,8 @@ $head = mailmanspip_admin_prepare_head();
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
$var=!$var;
$var=true;
if (! empty($conf->global->ADHERENT_USE_MAILMAN))
{
//$lien=img_picto($langs->trans("Active"),'tick').' ';

View File

@ -73,7 +73,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup');
print "<br>\n";
$head = order_admin_prepare_head(null);
$head = order_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Orders"), 0, 'order');

View File

@ -74,7 +74,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("OrdersSetup"),$linkback,'setup');
print "<br>\n";
$head = order_admin_prepare_head(null);
$head = order_admin_prepare_head();
dol_fiche_head($head, 'attributeslines', $langs->trans("Orders"), 0, 'order');

View File

@ -263,7 +263,7 @@ $form=new Form($db);
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("PropalSetup"),$linkback,'setup');
$head = propal_admin_prepare_head(null);
$head = propal_admin_prepare_head();
dol_fiche_head($head, 'general', $langs->trans("Proposals"), 0, 'propal');
@ -602,7 +602,7 @@ if ($conf->banque->enabled)
{
$var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td>&nbsp</td><td align="center">';
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td>&nbsp</td><td align="right">';
if (! empty($conf->use_javascript_ajax))
{
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL');

View File

@ -117,10 +117,11 @@ $head = mailmanspip_admin_prepare_head();
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
$var=true;
/*
* Spip
*/
$var=!$var;
if (! empty($conf->global->ADHERENT_USE_SPIP))
{
//$lien=img_picto($langs->trans("Active"),'tick').' ';

View File

@ -198,7 +198,7 @@ print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
print "<br>";
$head = supplierorder_admin_prepare_head(null);
$head = supplierorder_admin_prepare_head();
dol_fiche_head($head, 'invoice', $langs->trans("Suppliers"), 0, 'company');

View File

@ -199,7 +199,7 @@ print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
print "<br>";
$head = supplierorder_admin_prepare_head(null);
$head = supplierorder_admin_prepare_head();
dol_fiche_head($head, 'order', $langs->trans("Suppliers"), 0, 'company');

View File

@ -76,7 +76,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
print "<br>\n";
$head = supplierorder_admin_prepare_head(null);
$head = supplierorder_admin_prepare_head();
dol_fiche_head($head, 'supplierinvoice', $langs->trans("Suppliers"), 0, 'company');

View File

@ -73,7 +73,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
print "<br>\n";
$head = supplierorder_admin_prepare_head(null);
$head = supplierorder_admin_prepare_head();
dol_fiche_head($head, 'supplierorder', $langs->trans("Suppliers"), 0, 'company');

View File

@ -121,8 +121,8 @@ if ($action == 'builddoc')
if (! $error)
{
$code=$forbarcode;
$generator=$stdobject->barcode_type_coder;
$encoding=strtoupper($stdobject->barcode_type_code);
$generator=$stdobject->barcode_type_coder; // coder (loaded by fetch_barcode). Engine.
$encoding=strtoupper($stdobject->barcode_type_code); // code (loaded by fetch_barcode). Example 'ean', 'isbn', ...
$barcodeimage=$conf->barcode->dir_temp.'/barcode_'.$code.'_'.$encoding.'.png';
$diroutput=$conf->barcode->dir_temp;

View File

@ -44,6 +44,8 @@ $userid=GETPOST("userid","int");
$position=GETPOST("position","int");
$backtopage=GETPOST('backtopage','alpha');
$bookmark=new Bookmark($db);
/*
* Actions
@ -67,7 +69,6 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
exit;
}
$bookmark=new Bookmark($db);
if ($action == 'update') $bookmark->fetch($_POST["id"]);
$bookmark->fk_user=$userid;
$bookmark->title=$title;
@ -127,6 +128,17 @@ llxHeader();
$form=new Form($db);
$head = array();
$h=1;
$head[$h][0] = $_SERVER["PHP_SELF"].($bookmark->id?'id='.$bookmark->id:'');
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
$hselected='card';
if ($action == 'create')
{
/*
@ -179,7 +191,6 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
/*
* Fact bookmark mode or visually edition
*/
$bookmark=new Bookmark($db);
$bookmark->fetch($id);
$head = array(

View File

@ -16,7 +16,7 @@
*/
/**
* Return a string to outptu a keypad
* Return a string to output a keypad
*
* @param string $keypadname Key pad name
* @param string $formname Form name
@ -24,6 +24,8 @@
*/
function genkeypad($keypadname, $formname)
{
global $conf;
if (empty($conf->global->CASHDESK_SHOW_KEYPAD)) return '';
// défine the font size of button

View File

@ -69,7 +69,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("PropalSetup"),$linkback,'setup');
$head = propal_admin_prepare_head(null);
$head = propal_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Proposals"), 0, 'propal');

View File

@ -74,7 +74,7 @@ llxHeader('',$langs->trans("PropalSetup"));
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print_fiche_titre($langs->trans("PropalSetup"),$linkback,'setup');
$head = propal_admin_prepare_head(null);
$head = propal_admin_prepare_head();
dol_fiche_head($head, 'attributeslines', $langs->trans("Proposals"), 0, 'propal');

View File

@ -553,6 +553,8 @@ else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST(
}
}
include DOL_DOCUMENT_ROOT.'/core/actions_printipp.inc.php';
/*
* Send mail

View File

@ -1115,15 +1115,6 @@ else if ($action == 'remove_file') {
}
}
// Print file
else if ($action == 'print_file' and $user->rights->printipp->read) {
require_once DOL_DOCUMENT_ROOT . '/core/class/dolprintipp.class.php';
$printer = new dolPrintIPP($db, $conf->global->PRINTIPP_HOST, $conf->global->PRINTIPP_PORT, $user->login, $conf->global->PRINTIPP_USER, $conf->global->PRINTIPP_PASSWORD);
$printer->print_file(GETPOST('file', 'alpha'), GETPOST('printer', 'alpha'));
setEventMessage($langs->trans("FileWasSentToPrinter", GETPOST('file')));
$action = '';
}
else if ($action == 'update_extras') {
// Fill array 'array_options' with data from update form
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
@ -1151,6 +1142,9 @@ else if ($action == 'update_extras') {
$action = 'edit_extras';
}
include DOL_DOCUMENT_ROOT.'/core/actions_printipp.inc.php';
/*
* Send mail
*/

View File

@ -1615,14 +1615,7 @@ else if ($action == 'remove_file') {
}
}
// Print file
else if ($action == 'print_file' and $user->rights->printipp->read) {
require_once DOL_DOCUMENT_ROOT . '/core/class/dolprintipp.class.php';
$printer = new dolPrintIPP($db, $conf->global->PRINTIPP_HOST, $conf->global->PRINTIPP_PORT, $user->login, $conf->global->PRINTIPP_USER, $conf->global->PRINTIPP_PASSWORD);
$printer->print_file(GETPOST('file', 'alpha'), GETPOST('printer', 'alpha'));
setEventMessage($langs->trans("FileWasSentToPrinter", GETPOST('file')));
$action = '';
}
include DOL_DOCUMENT_ROOT.'/core/actions_printipp.inc.php';
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture->creer)
{

View File

@ -70,7 +70,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("BillsSetup"),$linkback,'setup');
print '<br>';
$head = invoice_admin_prepare_head(null);
$head = invoice_admin_prepare_head();
dol_fiche_head($head, 'attributes', $langs->trans("Invoices"), 0, 'invoice');

View File

@ -71,7 +71,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("BillsSetup"),$linkback,'setup');
print '<br>';
$head = invoice_admin_prepare_head(null);
$head = invoice_admin_prepare_head();
dol_fiche_head($head, 'attributeslines', $langs->trans("Invoices"), 0, 'invoice');

View File

@ -0,0 +1,45 @@
<?php
/* Copyright (C) 2014 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* 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 see http://www.gnu.org/
*/
/**
* \file htdocs/core/actions_printipp.inc.php
* \brief Code for actions print_file to print file using ipp
*/
// $action must be defined
// $db, $user, $conf, $langs must be defined
// Filename to print must be provided into 'file' parameter
// Print file
if ($action == 'print_file' and $user->rights->printipp->read)
{
$langs->load("printipp");
require_once DOL_DOCUMENT_ROOT . '/core/class/dolprintipp.class.php';
$printer = new dolPrintIPP($db, $conf->global->PRINTIPP_HOST, $conf->global->PRINTIPP_PORT, $user->login, $conf->global->PRINTIPP_USER, $conf->global->PRINTIPP_PASSWORD);
$result = $printer->print_file(GETPOST('file', 'alpha'), GETPOST('printer', 'alpha'));
if ($result)
{
setEventMessage($result,'warnings');
}
else
{
setEventMessage($langs->trans("FileWasSentToPrinter", basename(GETPOST('file'))));
}
$action = '';
}

View File

@ -633,7 +633,7 @@ abstract class CommonObject
/**
* Load data for barcode into properties ->barcode_type*
* Properties ->barcode_type that is id of barcode type is used to find other properties, but
* Properties ->barcode_type that is id of barcode. Type is used to find other properties, but
* if it is not defined, ->element must be defined to know default barcode type.
*
* @return int <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded)
@ -3029,7 +3029,7 @@ abstract class CommonObject
});</script>';
if (!empty($hidemargininfos)) print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>';
}
print '<table class="noborder margintable" width="100%">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">'.$langs->trans('Margins').'</td>';

View File

@ -253,7 +253,7 @@ class DolGraph
/**
* Set legend
*
* @param string $legend Legend
* @param array $legend Legend. Example: array('seriename1','seriname2',...)
* @return void
*/
function SetLegend($legend)

View File

@ -83,19 +83,22 @@ class dolprintIPP
* @param string $file file
* @param string $module module
*
* @return void
* @return string '' if OK, Error message if KO
*/
function print_file($file,$module)
function print_file($file, $module)
{
global $conf,$db;
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
$ipp = new CupsPrintIPP();
$ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose
$ipp->setLog(DOL_DATA_ROOT.'/dolibarr_printipp.log','file',3); // logging very verbose
$ipp->setHost($this->host);
$ipp->setPort($this->port);
$ipp->setJobName($file,true);
$ipp->setUserName($this->userid);
if (! empty($this->user)) $ipp->setAuthentication($this->user,$this->password);
// select printer uri for module order, propal,...
$sql = 'SELECT rowid,printer_uri,copy FROM '.MAIN_DB_PREFIX.'printer_ipp WHERE module="'.$module.'"';
$result = $this->db->query($sql);
@ -108,13 +111,23 @@ class dolprintIPP
}
else
{
$ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT);
if (! empty($conf->global->PRINTIPP_URI_DEFAULT))
{
$ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT);
}
else
{
return 'NoDefaultPrinterDefined';
}
}
}
// Set number of copy
$ipp->setCopies($obj->copy);
$ipp->setData(DOL_DATA_ROOT.'/'.$module.'/'.$file);
$ipp->printJob();
return '';
}
/**

View File

@ -270,7 +270,13 @@ class FormFile
if (! empty($iconPDF)) {
return $this->getDocumentsLink($modulepart, $modulesubdir, $filedir);
}
$printer = (!empty($user->rights->printipp->read) && !empty($conf->printipp->enabled))?true:false;
$printer=0;
if (in_array($modulepart,array('facture','propal','proposal','order','commande'))) // This feature is implemented only for such elements
{
$printer = (!empty($user->rights->printipp->read) && !empty($conf->printipp->enabled))?true:false;
}
$hookmanager->initHooks(array('formfile'));
$forname='builddoc';
$out='';

View File

@ -52,7 +52,6 @@ if (empty($font_loc)) die('DOL_DEFAULT_TTF_BOLD must de defined with full path t
if (defined('PHP-BARCODE_PATH_COMMAND')) $genbarcode_loc=constant('PHP-BARCODE_PATH_COMMAND');
else $genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
//dol_syslog("genbarcode_loc=".$genbarcode_loc." - env_windows=".$_SERVER['WINDIR']);

View File

@ -217,10 +217,9 @@ function societe_prepare_head2($object)
/**
* Return array head with list of tabs to view object informations.
*
* @param Object $object Thirdparty
* @return array head array with tabs
*/
function societe_admin_prepare_head($object)
function societe_admin_prepare_head()
{
global $langs, $conf, $user;
@ -236,7 +235,7 @@ function societe_admin_prepare_head($object)
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'company_admin');
complete_head_from_modules($conf,$langs,null,$head,$h,'company_admin');
$head[$h][0] = DOL_URL_ROOT.'/societe/admin/societe_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsThirdParties");
@ -248,7 +247,7 @@ function societe_admin_prepare_head($object)
$head[$h][2] = 'attributes_contacts';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'company_admin','remove');
complete_head_from_modules($conf,$langs,null,$head,$h,'company_admin','remove');
return $head;
}

View File

@ -160,10 +160,9 @@ function ordersupplier_prepare_head($object)
/**
* Return array head with list of tabs to view object informations.
*
* @param Object $object order
* @return array head array with tabs
*/
function supplierorder_admin_prepare_head($object)
function supplierorder_admin_prepare_head()
{
global $langs, $conf, $user;
@ -180,7 +179,7 @@ function supplierorder_admin_prepare_head($object)
$head[$h][2] = 'invoice';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'supplierorder_admin');
complete_head_from_modules($conf,$langs,null,$head,$h,'supplierorder_admin');
$head[$h][0] = DOL_URL_ROOT.'/admin/supplierorder_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsSupplierOrders");
@ -192,7 +191,7 @@ function supplierorder_admin_prepare_head($object)
$head[$h][2] = 'supplierinvoice';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'supplierorder_admin','remove');
complete_head_from_modules($conf,$langs,null,$head,$h,'supplierorder_admin','remove');
return $head;
}

View File

@ -4612,26 +4612,26 @@ function picto_from_langcode($codelang)
* Complete or removed entries into a head array (used to build tabs) with value added by external modules.
* Such values are declared into $conf->modules_parts['tab'].
*
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param Object $object Object object
* @param array $head Object head
* @param int $h New position to fill
* @param string $type Value for object where objectvalue can be
* 'thirdparty' to add a tab in third party view
* 'intervention' to add a tab in intervention view
* 'supplier_order' to add a tab in supplier order view
* 'supplier_invoice' to add a tab in supplier invoice view
* 'invoice' to add a tab in customer invoice view
* 'order' to add a tab in customer order view
* 'product' to add a tab in product view
* 'propal' to add a tab in propal view
* 'user' to add a tab in user view
* 'group' to add a tab in group view
* 'member' to add a tab in fundation member view
* 'categories_x' to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member)
* 'ecm' to add a tab for another ecm view
* @param string $mode 'add' to complete head, 'remove' to remove entries
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param Object|null $object Object object
* @param array $head Object head
* @param int $h New position to fill
* @param string $type Value for object where objectvalue can be
* 'thirdparty' to add a tab in third party view
* 'intervention' to add a tab in intervention view
* 'supplier_order' to add a tab in supplier order view
* 'supplier_invoice' to add a tab in supplier invoice view
* 'invoice' to add a tab in customer invoice view
* 'order' to add a tab in customer order view
* 'product' to add a tab in product view
* 'propal' to add a tab in propal view
* 'user' to add a tab in user view
* 'group' to add a tab in group view
* 'member' to add a tab in fundation member view
* 'categories_x' to add a tab in category view ('x': type of category (0=product, 1=supplier, 2=customer, 3=member)
* 'ecm' to add a tab for another ecm view
* @param string $mode 'add' to complete head, 'remove' to remove entries
* @return void
*/
function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode='add')

View File

@ -106,10 +106,9 @@ function facture_prepare_head($object)
/**
* Return array head with list of tabs to view object informations.
*
* @param Object $object Invoice
* @return array head array with tabs
*/
function invoice_admin_prepare_head($object)
function invoice_admin_prepare_head()
{
global $langs, $conf, $user;
@ -125,7 +124,7 @@ function invoice_admin_prepare_head($object)
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice_admin');
complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin');
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/admin/facture_cust_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsCustomerInvoices");
@ -137,7 +136,7 @@ function invoice_admin_prepare_head($object)
$head[$h][2] = 'attributeslines';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'invoice_admin','remove');
complete_head_from_modules($conf,$langs,null,$head,$h,'invoice_admin','remove');
return $head;
}

View File

@ -117,7 +117,7 @@ function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass)
/**
* Show a LDAP array into an HTML output array.
*
* @param string $result Array to show. This array is already encoded into charset_output
* @param array $result Array to show. This array is already encoded into charset_output
* @param int $level Level
* @param int $count Count
* @param string $var Var

View File

@ -116,10 +116,9 @@ function commande_prepare_head($object)
/**
* Return array head with list of tabs to view object informations.
*
* @param Object $object order
* @return array head array with tabs
* @return array head array with tabs
*/
function order_admin_prepare_head($object)
function order_admin_prepare_head()
{
global $langs, $conf, $user;
@ -131,7 +130,7 @@ function order_admin_prepare_head($object)
$head[$h][2] = 'general';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'order_admin');
complete_head_from_modules($conf,$langs,null,$head,$h,'order_admin');
$head[$h][0] = DOL_URL_ROOT.'/admin/order_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
@ -143,7 +142,7 @@ function order_admin_prepare_head($object)
$head[$h][2] = 'attributeslines';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'order_admin','remove');
complete_head_from_modules($conf,$langs,null,$head,$h,'order_admin','remove');
return $head;
}

View File

@ -147,10 +147,9 @@ function product_prepare_head($object, $user)
/**
* Return array head with list of tabs to view object informations.
*
* @param Object $object Product
* @return array head array with tabs
*/
function product_admin_prepare_head($object=null)
function product_admin_prepare_head()
{
global $langs, $conf, $user;
@ -166,14 +165,14 @@ function product_admin_prepare_head($object=null)
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'product_admin');
complete_head_from_modules($conf,$langs,null,$head,$h,'product_admin');
$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'product_admin','remove');
complete_head_from_modules($conf,$langs,null,$head,$h,'product_admin','remove');
return $head;
}

View File

@ -357,7 +357,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '</td>';
// Planned Workload (in working hours)
print '<td align="center">';
print '<td align="right">';
$fullhour=convertSecondToTime($lines[$i]->planned_workload,'allhourmin');
$workingdelay=convertSecondToTime($lines[$i]->planned_workload,'all',86400,7); // TODO Replace 86400 and 7 to take account working hours per day and working day per weeks
if ($lines[$i]->planned_workload)
@ -422,7 +422,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td align="center" class="nowrap liste_total">';
print '<td align="right" class="nowrap liste_total">';
print convertSecondToTime($total_projectlinesa_planned, 'allhourmin');
print '</td>';
print '<td></td>';

View File

@ -110,10 +110,9 @@ function propal_prepare_head($object)
/**
* Return array head with list of tabs to view object informations.
*
* @param Object $object Propal
* @return array head array with tabs
*/
function propal_admin_prepare_head($object)
function propal_admin_prepare_head()
{
global $langs, $conf, $user;
@ -129,7 +128,7 @@ function propal_admin_prepare_head($object)
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_admin');
complete_head_from_modules($conf,$langs,null,$head,$h,'propal_admin');
$head[$h][0] = DOL_URL_ROOT.'/comm/admin/propal_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields");
@ -141,7 +140,7 @@ function propal_admin_prepare_head($object)
$head[$h][2] = 'attributeslines';
$h++;
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_admin','remove');
complete_head_from_modules($conf,$langs,null,$head,$h,'propal_admin','remove');
return $head;
}

View File

@ -242,9 +242,9 @@ function entity_prepare_head($object, $aEntities)
/**
* Show list of themes. Show all thumbs of themes
*
* @param User $fuser User concerned or null for global theme
* @param int $edit 1 to add edit form
* @param boolean $foruserprofile Show for user profile view
* @param User|null $fuser User concerned or null for global theme
* @param int $edit 1 to add edit form
* @param boolean $foruserprofile Show for user profile view
* @return void
*/
function show_theme($fuser,$edit=0,$foruserprofile=false)

View File

@ -51,7 +51,7 @@ class modPrintIPP extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Print via Cups IPP Printer.";
$this->version = 'experimental'; // 'development' or 'experimental' or 'dolibarr' or version
$this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
$this->special = 1;
@ -67,10 +67,11 @@ class modPrintIPP extends DolibarrModules
$this->config_page_url = array("printipp.php@printipp");
// Dependances
$this->hidden = (! empty($_SERVER["WINDIR"]));
$this->depends = array();
$this->requiredby = array();
$this->phpmin = array(5,1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3,2); // Minimum version of Dolibarr required by module
$this->phpmin = array(5,1); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3,7,-2); // Minimum version of Dolibarr required by module
$this->conflictwith = array();
$this->langfiles = array("printipp");

View File

@ -475,8 +475,8 @@ Module320Name=RSS Feed
Module320Desc=Add RSS feed inside Dolibarr screen pages
Module330Name=Bookmarks
Module330Desc=Bookmark management
Module400Name=Projects/Opportunity
Module400Desc=Management of projects or opportunity. You can then assign all other elements (invoice, order, proposal, intervention, ...) to this projects
Module400Name=Projects/Opportunities/Leads
Module400Desc=Management of projects, opportunities or leads. You can then assign any element (invoice, order, proposal, intervention, ...) to a project and get a transversal view from the project view.
Module410Name=Webcalendar
Module410Desc=Webcalendar integration
Module500Name=Special expenses (tax, social contributions, dividends)
@ -531,7 +531,7 @@ Module50200Desc=Module to offer an online payment page by credit card with Paypa
Module50400Name=Accounting (advanced)
Module50400Desc=Accounting management (double parties)
Module54000Name=PrintIPP
Module54000Desc=Print via Cups IPP Printer.
Module54000Desc=Direct print (without opening the documents) using Cups IPP interface (Printer must be visible from server, and CUPS must be installe on server).
Module55000Name=Open Poll
Module55000Desc=Module to make online polls (like Doodle, Studs, Rdvz, ...)
Module59000Name=Margins

View File

@ -7,3 +7,8 @@ PRINTIPP_PORT=Port
PRINTIPP_USER=Login
PRINTIPP_PASSWORD=Password
NoPrinterFound=No printers found (check your CUPS setup)
FileWasSentToPrinter=File %s was sent to printer
NoDefaultPrinterDefined=No default printer defined
DefaultPrinter=Default printer
Printer=Printer
CupsServer=CUPS Server

View File

@ -36,6 +36,8 @@ TaskTimeSpent=Time spent on tasks
TaskTimeUser=User
TaskTimeNote=Note
TaskTimeDate=Date
TasksOnOpenedProject=Tasks on opened projects
WorkloadNotDefined=Workload not defined
NewTimeSpent=New time spent
MyTimeSpent=My time spent
MyTasks=My tasks

View File

@ -35,6 +35,7 @@ if (! $user->admin) accessforbidden();
$action = GETPOST('action','alpha');
$mode = GETPOST('mode','alpha');
$value = GETPOST('value','alpha');
if (!$mode) $mode='config';
@ -68,6 +69,17 @@ if ($action == 'setvalue' && $user->admin)
}
}
// Set default model
else if ($action == 'setprinteruri')
{
if (dolibarr_set_const($db, "PRINTIPP_URI_DEFAULT",$value,'chaine',0,'',$conf->entity))
{
// La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent
$conf->global->PRINTIPP_URI_DEFAULT = $value;
}
}
/*
* View
@ -82,11 +94,6 @@ print_fiche_titre($langs->trans("PrintIPPSetup"),$linkback,'setup');
$head=printippadmin_prepare_head();
dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"));
print $langs->trans("PrintIPPDesc")."<br>\n";
print '<br>';
if ($mode == 'config' && $user->admin)
{
@ -94,8 +101,11 @@ if ($mode == 'config' && $user->admin)
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setvalue">';
dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic');
print '<table class="nobordernopadding" width="100%">';
print $langs->trans("PrintIPPDesc")."<br><br>\n";
print '<table class="noborder" width="100%">';
$var=true;
print '<tr class="liste_titre">';
@ -103,8 +113,9 @@ if ($mode == 'config' && $user->admin)
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
/*
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PRINTIPP_ENABLED").'</td><td colspan="2" align="left">';
if (! empty($conf->use_javascript_ajax))
@ -123,7 +134,8 @@ if ($mode == 'config' && $user->admin)
}
}
print '</td></tr>';
*/
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print $langs->trans("PRINTIPP_HOST").'</td><td>';
@ -139,13 +151,13 @@ if ($mode == 'config' && $user->admin)
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PRINTIPP_USER").'</td><td>';
print '<input size="32" type="text" name="PRINTIPP_USER" value="'.$conf->global->PRINTIPP_USER.'">';
print '</td></tr>';
$var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired">';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("PRINTIPP_PASSWORD").'</td><td>';
print '<input size="32" type="text" name="PRINTIPP_PASSWORD" value="'.$conf->global->PRINTIPP_PASSWORD.'">';
print '</td></tr>';
@ -156,16 +168,22 @@ if ($mode == 'config' && $user->admin)
//print '<td>'.$langs->trans("Value").'</td>';
//print "</tr>\n";
print '<tr><td colspan="2" align="center"><br><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
print '</table>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("Modify")).'"></center>';
print '</form>';
}
if ($mode == 'test' && $user->admin)
{
print '<table class="nobordernopadding" width="100%">';
dol_fiche_head($head, $mode, $langs->trans("ModuleSetup"), 0, 'technic');
print $langs->trans("PrintIPPDesc")."<br><br>\n";
print '<table class="nobordernopadding" width="100%">';
$printer = new dolPrintIPP($db,$conf->global->PRINTIPP_HOST,$conf->global->PRINTIPP_PORT,$user->login,$conf->global->PRINTIPP_USER,$conf->global->PRINTIPP_PASSWORD);
$var=true;
print '<table width="100%" class="noborder">';
@ -180,6 +198,7 @@ if ($mode == 'test' && $user->admin)
//print '<td>Device</td>';
print '<td>Media</td>';
print '<td>Supported</td>';
print '<td>'.$langs->trans("Select").'</td>';
print "</tr>\n";
$list = $printer->getlist_available_printers();
@ -200,14 +219,26 @@ if ($mode == 'test' && $user->admin)
//print '<td>'.$printer_det->device_uri->_value0.'</td>';
print '<td>'.$printer_det->media_default->_value0.'</td>';
print '<td>'.$printer_det->media_type_supported->_value1.'</td>';
// Defaut
print "<td align=\"center\">";
if ($conf->global->PRINTIPP_URI_DEFAULT == "$value")
{
print img_picto($langs->trans("Default"),'on');
}
else
{
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setprinteruri&mode=test&value='.urlencode($value).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
}
print '</td>';
print "</tr>\n";
}
print '</table>';
if (count($list) == 0) print $langs->trans("NoPrinterFound");
dol_fiche_end();
}
dol_fiche_end();
llxFooter();

View File

@ -36,12 +36,12 @@ function printippadmin_prepare_head()
$head = array();
$head[$h][0] = DOL_URL_ROOT."/printipp/admin/printipp.php?mode=config";
$head[$h][1] = $langs->trans("Config");
$head[$h][1] = $langs->trans("CupsServer");
$head[$h][2] = 'config';
$h++;
$head[$h][0] = DOL_URL_ROOT."/printipp/admin/printipp.php?mode=test";
$head[$h][1] = $langs->trans("Test");
$head[$h][1] = $langs->trans("Printer");
$head[$h][2] = 'test';
$h++;

View File

@ -124,9 +124,9 @@ class Product extends CommonObject
//! barcode
var $barcode; // value
var $barcode_type; // id
var $barcode_type_code; // code (loaded by fetch_barcode). Example ean, isbn...
var $barcode_type_code; // code (loaded by fetch_barcode). Example 'ean', 'isbn', ...
var $barcode_type_label; // label (loaded by fetch_barcode)
var $barcode_type_coder; // coder (loaded by fetch_barcode)
var $barcode_type_coder; // coder (loaded by fetch_barcode). Engine.
var $stats_propale=array();
var $stats_commande=array();

View File

@ -164,18 +164,21 @@ dol_fiche_end();
$listofreferent=array(
'propal'=>array(
'name'=>"Proposalq",
'title'=>"ListProposalsAssociatedProject",
'class'=>'Propal',
'table'=>'propal',
'datefieldname'=>'datep',
'test'=>$conf->propal->enabled && $user->rights->propale->lire),
'order'=>array(
'name'=>"CustomerOrderq",
'title'=>"ListOrdersAssociatedProject",
'class'=>'Commande',
'table'=>'commande',
'datefieldname'=>'date_commande',
'test'=>$conf->commande->enabled && $user->rights->commande->lire),
'invoice'=>array(
'name'=>"CustomerInvoiceq",
'title'=>"ListInvoicesAssociatedProject",
'class'=>'Facture',
'margin'=>'add',
@ -183,18 +186,21 @@ $listofreferent=array(
'datefieldname'=>'datef',
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'invoice_predefined'=>array(
'name'=>"PredefinedInvoices",
'title'=>"ListPredefinedInvoicesAssociatedProject",
'class'=>'FactureRec',
'table'=>'facture_rec',
'datefieldname'=>'datec',
'test'=>$conf->facture->enabled && $user->rights->facture->lire),
'order_supplier'=>array(
'name'=>"SuplierOrders",
'title'=>"ListSupplierOrdersAssociatedProject",
'class'=>'CommandeFournisseur',
'table'=>'commande_fournisseur',
'datefieldname'=>'date_commande',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire),
'invoice_supplier'=>array(
'name'=>"BillsSuppliers",
'title'=>"ListSupplierInvoicesAssociatedProject",
'class'=>'FactureFournisseur',
'margin'=>'minus',
@ -202,12 +208,14 @@ $listofreferent=array(
'datefieldname'=>'datef',
'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire),
'contract'=>array(
'name'=>"Contracts",
'title'=>"ListContractAssociatedProject",
'class'=>'Contrat',
'table'=>'contrat',
'datefieldname'=>'date_contrat',
'test'=>$conf->contrat->enabled && $user->rights->contrat->lire),
'intervention'=>array(
'name'=>"Interventions",
'title'=>"ListFichinterAssociatedProject",
'class'=>'Fichinter',
'table'=>'fichinter',
@ -215,6 +223,7 @@ $listofreferent=array(
'disableamount'=>1,
'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
'trip'=>array(
'name'=>"TripAndExpenses",
'title'=>"ListTripAssociatedProject",
'class'=>'Deplacement',
'table'=>'deplacement',
@ -223,6 +232,7 @@ $listofreferent=array(
'disableamount'=>1,
'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire),
'agenda'=>array(
'name'=>"Agenda",
'title'=>"ListActionsAssociatedProject",
'class'=>'ActionComm',
'table'=>'actioncomm',
@ -445,8 +455,13 @@ foreach ($listofreferent as $key => $value)
}
}
// Margin display of the project
print_titre("Margin");
// Profit for all project
$langs->load("suppliers");
$langs->load("bills");
$langs->load("orders");
$langs->load("proposals");
$langs->load("margin");
print_titre($langs->trans("Profit"));
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td align="left" width="200">'.$langs->trans("Element").'</td>';
@ -455,9 +470,9 @@ print '<td align="right" width="100">'.$langs->trans("AmountHT").'</td>';
print '<td align="right" width="100">'.$langs->trans("AmountTTC").'</td>';
print '</tr>';
foreach ($listofreferent as $key => $value)
{
$name=$langs->trans($value['name']);
$title=$value['title'];
$classname=$value['class'];
$tablename=$value['table'];
@ -486,7 +501,7 @@ foreach ($listofreferent as $key => $value)
}
print '<tr >';
print '<td align="left" >'.$classname.'</td>';
print '<td align="left" >'.$name.'</td>';
print '<td align="right">'.$i.'</td>';
print '<td align="right">'.price($total_ht).'</td>';
print '<td align="right">'.price($total_ttc).'</td>';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
@ -49,6 +49,7 @@ $sortorder = GETPOST("sortorder",'alpha');
$socstatic=new Societe($db);
$projectstatic=new Project($db);
$userstatic=new User($db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)),1);
//var_dump($projectsListId);
@ -156,20 +157,23 @@ print '</div></div></div>';
// Tasks for all resources of all opened projects and time spent for each task/resource
print '<div class="fichecenter">';
$sql = "SELECT p.ref, p.title, p.rowid as projectid, t.label, t.rowid as taskid, u.rowid as userid, t.planned_workload, t.dateo, t.datee, SUM(tasktime.task_duration) as timespent";
$max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA);
$sql = "SELECT p.ref, p.title, p.rowid as projectid, t.label, t.rowid as taskid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee, SUM(tasktime.task_duration) as timespent";
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid";
$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid";
$sql.= " WHERE p.entity = ".$conf->entity;
if ($mine || ! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")";
$sql.= " AND p.fk_statut=1";
$sql.= " GROUP BY p.ref, p.title, p.rowid, t.label, t.rowid, u.rowid, t.planned_workload, t.dateo, t.datee";
$sql.= " ORDER BY u.rowid, t.dateo, t.datee";
$sql.= " GROUP BY p.ref, p.title, p.rowid, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee";
$sql.= " ORDER BY t.rowid, t.dateo, t.datee";
$sql.= $db->plimit($max+1); // We want more to know if we have more than limit
$userstatic=new User($db);
$var=true;
dol_syslog('projet:index.php: affectationpercent', LOG_DEBUG);
$resql = $db->query($sql);
@ -178,75 +182,87 @@ if ( $resql )
$num = $db->num_rows($resql);
$i = 0;
if ($num > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
print '<br>';
print_fiche_titre($langs->trans("TasksOnOpenedProject"),'','').'<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
//print '<th>'.$langs->trans('TaskRessourceLinks').'</th>';
print '<th>'.$langs->trans('Projects').'</th>';
print '<th>'.$langs->trans('Task').'</th>';
print '<th>'.$langs->trans('DateStart').'</th>';
print '<th>'.$langs->trans('DateEnd').'</th>';
print '<th align="right">'.$langs->trans('PlannedWorkload').'</th>';
print '<th align="right">'.$langs->trans("ProgressDeclared").'</td>';
print '<th align="right">'.$langs->trans('TimeSpent').'</th>';
print '<th align="right">'.$langs->trans("ProgressCalculated").'</td>';
print '</tr>';
while ($i < $num && $i < $max)
{
/* $langs->load("errors");
print '<tr '.$bc[0].'>';
print '<td colspan="9">';
print $langs->trans("WarningTooManyDataPleaseUseMoreFilters");
print '</td></tr>';*/
}
else
{
print '<br>';
$obj = $db->fetch_object($resql);
$var=!$var;
print_fiche_titre($langs->trans("TimeSpent"),'','').'<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<th>'.$langs->trans('TaskRessourceLinks').'</th>';
print '<th>'.$langs->trans('Projects').'</th>';
print '<th>'.$langs->trans('Task').'</th>';
print '<th>'.$langs->trans('DateStart').'</th>';
print '<th>'.$langs->trans('DateEnd').'</th>';
print '<th>'.$langs->trans('TimeSpent').'</th>';
print '</tr>';
while ($i < $num)
$username='';
if ($obj->userid && $userstatic->id != $obj->userid) // We have a user and it is not last loaded user
{
$obj = $db->fetch_object($resql);
$var=!$var;
$username='';
if ($obj->userid && $userstatic->id != $obj->userid) // We have a user and it is not last loaded user
{
$result=$userstatic->fetch($obj->userid);
if (! $result) $userstatic->id=0;
}
if ($userstatic->id) $username = $userstatic->getNomUrl(0,0);
print "<tr ".$bc[$var].">";
print '<td>'.$username.'</td>';
print '<td>';
$projectstatic->id=$obj->projectid;
$projectstatic->ref=$obj->ref;
$projectstatic->title=$obj->title;
print $projectstatic->getNomUrl(1,'',16);
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$obj->projectid.'">'.$obj->title.'</a>';
print '</td>';
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$obj->taskid.'&withproject=1">'.$obj->label.'</a></td>';
print '<td>'.dol_print_date($db->jdate($obj->dateo)).'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datee)).'</td>';
/* I disable this because information is wrong. This percent has no meaning for a particular resource. What do we want ?
* Percent of completion ?
* If we want to show completion, we must remove "user" into list,
if (empty($obj->planned_workload)) {
$percentcompletion = $langs->trans("Unknown");
} else {
$percentcompletion = intval($obj->task_duration*100/$obj->planned_workload);
}*/
print '<td><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
//print $percentcompletion.' %';
print convertSecondToTime($obj->timespent, 'all');
print '</a></td>';
print "</tr>\n";
$i++;
$result=$userstatic->fetch($obj->userid);
if (! $result) $userstatic->id=0;
}
if ($userstatic->id) $username = $userstatic->getNomUrl(0,0);
print "</table>";
print "<tr ".$bc[$var].">";
//print '<td>'.$username.'</td>';
print '<td>';
$projectstatic->id=$obj->projectid;
$projectstatic->ref=$obj->ref;
$projectstatic->title=$obj->title;
print $projectstatic->getNomUrl(1,'',16);
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$obj->projectid.'">'.$obj->title.'</a>';
print '</td>';
print '<td>';
if (! empty($obj->taskid))
{
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/task.php?id='.$obj->taskid.'&withproject=1">'.$obj->label.'</a>';
}
else print $langs->trans("NoTasks");
print '</td>';
print '<td>'.dol_print_date($db->jdate($obj->dateo),'day').'</td>';
print '<td>'.dol_print_date($db->jdate($obj->datee),'day').'</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
print convertSecondToTime($obj->planned_workload, 'all');
print '</a></td>';
print '<td align="right">';
print ($obj->taskid>0)?$obj->progress.'%':'';
print '</td>';
print '<td align="right"><a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$obj->taskid.'&withproject=1">';
print convertSecondToTime($obj->timespent, 'all');
print '</a></td>';
print '<td align="right">';
if (! empty($obj->taskid))
{
if (empty($obj->planned_workload) > 0) {
$percentcompletion = $langs->trans("WorkloadNotDefined");
} else {
$percentcompletion = intval($obj->duration_effective*100/$obj->planned_workload).'%';
}
}
print $percentcompletion;
print '</td>';
print "</tr>\n";
$i++;
}
if ($num > $max)
{
print '<tr><td colspan="6">'.$langs->trans("WarningTooManyDataPleaseUseMoreFilters").'</td></tr>';
}
print "</table>";
$db->free($resql);
}
else

View File

@ -417,7 +417,7 @@ else
print '<td>'.$langs->trans("LabelTask").'</td>';
print '<td align="center">'.$langs->trans("DateStart").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="center">'.$langs->trans("PlannedWorkload").'</td>';
print '<td align="right">'.$langs->trans("PlannedWorkload").'</td>';
print '<td align="right">'.$langs->trans("ProgressDeclared").'</td>';
print '<td align="right">'.$langs->trans("TimeSpent").'</td>';
print '<td align="right">'.$langs->trans("ProgressCalculated").'</td>';

View File

@ -92,7 +92,7 @@ else
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,$mine,1,$socid);
// Get list of tasks in tasksarray and taskarrayfiltered
// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).
// We need all tasks (even not limited to a user because a task assigned to a user can have a parent that is not assigned to him and we need such parents).
$tasksarray=$taskstatic->getTasksArray(0, 0, $projectstatic->id, $socid, 0, $search_project, $search_status);
// We load also tasks limited to a particular user
$tasksrole=($mine ? $taskstatic->getUserRolesForProjectsOrTasks(0,$user,$projectstatic->id,0) : '');
@ -133,7 +133,9 @@ print '<input type="image" class="liste_titre" name="button_search" src="'.img_p
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
if (count($tasksarray) > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
$max=1000;
if (count($tasksarray) > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?$max:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
{
$langs->load("errors");
print '<tr '.$bc[0].'>';

View File

@ -295,9 +295,6 @@ if ($id > 0 || ! empty($ref))
//$arrayofuseridoftask=$object->getListContactId('internal');
$head=task_prepare_head($object);
dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask');
if ($action == 'edit' && $user->rights->projet->creer)
{
@ -307,6 +304,8 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask');
print '<table class="border" width="100%">';
// Ref
@ -372,9 +371,10 @@ if ($id > 0 || ! empty($ref))
print '</table>';
print '<br><div class="center">';
print '<input type="submit" class="button" name="update" value="'.$langs->trans("Modify").'">';
print '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
dol_fiche_end();
print '<div align="center">';
print '<input type="submit" class="button" name="update" value="'.$langs->trans("Modify").'"> &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</div>';
@ -388,6 +388,8 @@ if ($id > 0 || ! empty($ref))
$param=($withproject?'&withproject=1':'');
$linkback=$withproject?'<a href="'.DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.'">'.$langs->trans("BackToList").'</a>':'';
dol_fiche_head($head, 'task_task', $langs->trans("Task"),0,'projecttask');
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"].'&withproject='.$withproject,$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
@ -472,12 +474,11 @@ if ($id > 0 || ! empty($ref))
print '</table>';
dol_fiche_end();
}
dol_fiche_end();
if ($_GET["action"] != 'edit')
if ($action != 'edit')
{
/*
* Actions

View File

@ -337,30 +337,6 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>';
}
// Date start
print '<tr><td>'.$langs->trans("DateStart").'</td><td colspan="3">';
print dol_print_date($object->date_start,'dayhour');
print '</td></tr>';
// Date end
print '<tr><td>'.$langs->trans("DateEnd").'</td><td colspan="3">';
print dol_print_date($object->date_end,'dayhour');
print '</td></tr>';
// Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'.convertSecondToTime($object->planned_workload,'allhourmin').'</td></tr>';
// Declared progress
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
print $object->progress.' %';
print '</td></tr>';
// Calculated progress
print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">';
if ($object->planned_workload) print round(100 * $object->duration_effective / $object->planned_workload,2).' %';
else print '';
print '</td></tr>';
print '</table>';
dol_fiche_end();
@ -412,7 +388,7 @@ if ($id > 0 || ! empty($ref))
// Note
print '<td class="nowrap">';
print '<textarea name="timespent_note" cols="80" rows="'.ROWS_3.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>';
print '<textarea name="timespent_note" cols="80" rows="'.ROWS_2.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>';
print '</td>';
// Progress declared
@ -469,7 +445,8 @@ if ($id > 0 || ! empty($ref))
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="updateline">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="withproject" value="'.$withproject.'">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td width="100">'.$langs->trans("Date").'</td>';
@ -524,7 +501,7 @@ if ($id > 0 || ! empty($ref))
print '<td align="left">';
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
{
print '<textarea name="timespent_note_line" cols="80" rows="'.ROWS_3.'">'.$task_time->note.'</textarea>';
print '<textarea name="timespent_note_line" cols="80" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>';
}
else
{

View File

@ -68,7 +68,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
print_fiche_titre($langs->trans("CompanySetup"),$linkback,'setup');
$head = societe_admin_prepare_head(null);
$head = societe_admin_prepare_head();
dol_fiche_head($head, 'attributes_contacts', $langs->trans("ThirdParties"), 0, 'company');