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

Conflicts:
	htdocs/bookmarks/card.php
This commit is contained in:
Laurent Destailleur 2014-11-27 22:01:02 +01:00
commit 60e5369db2
21 changed files with 330 additions and 228 deletions

View File

@ -260,6 +260,12 @@ source_file = htdocs/langs/en_US/propal.lang
source_lang = en_US source_lang = en_US
type = MOZILLAPROPERTIES type = MOZILLAPROPERTIES
[dolibarr.resource]
file_filter = htdocs/langs/<lang>/resource.lang
source_file = htdocs/langs/en_US/resource.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.salaries] [dolibarr.salaries]
file_filter = htdocs/langs/<lang>/salaries.lang file_filter = htdocs/langs/<lang>/salaries.lang
source_file = htdocs/langs/en_US/salaries.lang source_file = htdocs/langs/en_US/salaries.lang

View File

@ -139,6 +139,8 @@ if ($action == 'create')
print_fiche_titre($langs->trans("NewBookmark")); print_fiche_titre($langs->trans("NewBookmark"));
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>'; print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input class="flat" name="title" size="30" value="'.$title.'"></td><td class="hideonsmartphone">'.$langs->trans("SetHereATitleForLink").'</td></tr>';
@ -159,7 +161,9 @@ if ($action == 'create')
print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">'; print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
print '</td><td class="hideonsmartphone">&nbsp;</td></tr>'; print '</td><td class="hideonsmartphone">&nbsp;</td></tr>';
print '</table><br>'; print '</table>';
dol_fiche_end();
print '<div align="center">'; print '<div align="center">';
print '<input type="submit" class="button" value="'.$langs->trans("CreateBookmark").'" name="create"> &nbsp; '; print '<input type="submit" class="button" value="'.$langs->trans("CreateBookmark").'" name="create"> &nbsp; ';
@ -186,8 +190,6 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
) )
); );
dol_fiche_head($head, 'card', $langs->trans("Bookmark"),0,'bookmark');
if ($action == 'edit') if ($action == 'edit')
{ {
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">'; print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
@ -198,6 +200,8 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
} }
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>';
@ -275,12 +279,14 @@ if ($id > 0 && ! preg_match('/^add/i',$action))
print '</table>'; print '</table>';
if ($action == 'edit') print '<br><div align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
if ($action == 'edit') print '</form>';
dol_fiche_end(); dol_fiche_end();
if ($action == 'edit')
{
print '<div align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print '</form>';
}
print "<div class=\"tabsAction\">\n"; print "<div class=\"tabsAction\">\n";

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Frederic France <frederic.france@free.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -22,14 +23,13 @@
/** /**
* \file htdocs/comm/propal/apercu.php * \file htdocs/comm/propal/apercu.php
* \ingroup propal * \ingroup propal
* \brief Page de l'onglet apercu d'une propal * \brief Preview tab of propal
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load('propal'); $langs->load('propal');
$langs->load("bills"); $langs->load("bills");
@ -44,18 +44,11 @@ $result = restrictedArea($user, 'propal', $id);
/* /*
* View * View Mode
*/ */
llxHeader(); llxHeader();
$form = new Form($db);
/* *************************************************************************** */
/* */
/* Mode fiche */
/* */
/* *************************************************************************** */
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
@ -76,26 +69,27 @@ if ($id > 0 || ! empty($ref))
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="5">'.$object->ref.'</td></tr>'; print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
print '<td colspan="5">'.$object->ref.'</td>';
print '</tr>';
// Ref client // Ref client
print '<tr><td>'; print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">'; print '<td colspan="5">'.$object->ref_client.'</td>';
print $langs->trans('RefCustomer').'</td><td align="left">';
print '</td>';
print '</tr></table>';
print '</td><td colspan="5">';
print $object->ref_client;
print '</td>';
print '</tr>'; print '</tr>';
$rowspan=2;
// Tiers // Thirdparty
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$soc->getNomUrl(1).'</td>'; print '<tr><td>'.$langs->trans('Company').'</td>';
print '<td colspan="5">'.$soc->getNomUrl(1).'</td>';
print '</tr>'; print '</tr>';
// Ligne info remises tiers // Status
print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td colspan="5">'.$object->getLibStatut(4).'</td>';
print '</tr>';
// Discount
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">'; print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">';
if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent); if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_percent);
else print $langs->trans("CompanyHasNoRelativeDiscount"); else print $langs->trans("CompanyHasNoRelativeDiscount");
@ -103,17 +97,16 @@ if ($id > 0 || ! empty($ref))
print '. '; print '. ';
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency)); if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->currency));
else print $langs->trans("CompanyHasNoAbsoluteDiscount"); else print $langs->trans("CompanyHasNoAbsoluteDiscount");
print '.'; print '.</td>';
print '</td></tr>'; print '</tr>';
// ligne // Date
// partie Gauche print '<tr><td>'.$langs->trans('Date').'</td>';
print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">'; print '<td>'.dol_print_date($object->date,'daytext').'</td>';
print dol_print_date($object->date,'daytext');
print '</td>';
// partie Droite sur $rowspan lignes // Right part with $rowspan lines
print '<td colspan="2" rowspan="'.$rowspan.'" valign="top" width="50%">'; $rowspan=4;
print '<td rowspan="'.$rowspan.'" valign="top" width="50%">';
/* /*
* Documents * Documents
@ -137,10 +130,10 @@ if ($id > 0 || ! empty($ref))
if (file_exists($file)) if (file_exists($file))
{ {
$encfile = urlencode($file); $encfile = urlencode($file);
print_titre($langs->trans("Documents")); print '<table class="nobordernopadding" width="100%">';
print '<table class="border" width="100%">'; print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Documents").'</td></tr>';
print "<tr ".$bc[$var]."><td>".$langs->trans("Propal")." PDF</td>"; print '<tr '.$bc[$var].'><td>'.$langs->trans("Proposal").' PDF</td>';
print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>'; print '<td><a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart=propal&file='.urlencode($relativepath).'">'.$object->ref.'.pdf</a></td>';
@ -166,12 +159,24 @@ if ($id > 0 || ! empty($ref))
} }
} }
print "</td>"; print '</td>';
print '</tr>';
// Total HT - left part
print '<tr><td>'.$langs->trans('AmountHT').'</td>';
print '<td align="right" class="nowrap"><b>' . price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
print '</tr>';
// Total VAT - left part
print '<tr><td>'.$langs->trans('AmountVAT').'</td>';
print '<td align="right" class="nowrap"><b>' . price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
print '</tr>';
// Total TTC - left part
print '<tr><td>'.$langs->trans('AmountTTC').'</td>';
print '<td align="right" class="nowrap"><b>' . price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency) . '</b></td>';
print '</tr>'; print '</tr>';
print '<tr><td height="10">'.$langs->trans('AmountHT').'</td>';
print '<td align="right" colspan="2"><b>'.price($object->price).'</b></td>';
print '<td>'.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
@ -183,10 +188,13 @@ if ($id > 0 || ! empty($ref))
} }
} }
print '<table class="border" width="100%">';
print '<tr><td>';
print '<div class="photolist">';
// Si fichier png PDF d'1 page trouve // Si fichier png PDF d'1 page trouve
if (file_exists($fileimage)) if (file_exists($fileimage))
{ {
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimage).'">'; print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&amp;file='.urlencode($relativepathimage).'">';
} }
// Si fichier png PDF de plus d'1 page trouve // Si fichier png PDF de plus d'1 page trouve
elseif (file_exists($fileimagebis)) elseif (file_exists($fileimagebis))
@ -199,10 +207,13 @@ elseif (file_exists($fileimagebis))
if (file_exists($dir_output.$preview)) if (file_exists($dir_output.$preview))
{ {
print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($preview).'"><p>'; print '<img class="photo photowithmargin" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&amp;file='.urlencode($preview).'"><p>';
} }
} }
} }
print '</div>';
print '</td></tr>';
print '</table>';
llxFooter(); llxFooter();

View File

@ -220,7 +220,7 @@ class Account extends CommonObject
/** /**
* Add an entry into table ".MAIN_DB_PREFIX."bank * Add an entry into table ".MAIN_DB_PREFIX."bank
* *
* @param timsestmap $date Date operation * @param timestamp $date Date operation
* @param string $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ... * @param string $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ...
* @param string $label Descripton * @param string $label Descripton
* @param float $amount Amount * @param float $amount Amount

View File

@ -76,7 +76,7 @@ if ($action == 'update')
if (empty($amount)) if (empty($amount))
{ {
$setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
$action = "create"; $action = "create";
$error++; $error++;
} }

View File

@ -228,7 +228,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
print '</td><td class="nocellnopadd boxclose nowrap">'; print '</td><td class="nocellnopadd boxclose nowrap">';
// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
print img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone" style="cursor:move;"'); print img_picto($langs->trans("MoveBox",$this->box_id),'grip_title','class="boxhandle hideonsmartphone" style="cursor:move;"');
print img_picto($langs->trans("Close",$this->box_id),'close_title','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"'); print img_picto($langs->trans("Close2",$this->box_id),'close_title','class="boxclose" rel="x:y" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
$label=$head['text']; $label=$head['text'];
if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; if (! empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')';
print '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">'; print '<input type="hidden" id="boxlabelentry'.$this->box_id.'" value="'.dol_escape_htmltag($label).'">';

View File

@ -43,11 +43,11 @@ class InfoBox
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $mode 'available' or 'activated' * @param string $mode 'available' or 'activated'
* @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for xxx, ...) * @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for xxx, ...)
* @param User $user Object user to filter * @param User|null $user Object user to filter
* @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude * @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude
* @return array Array of boxes * @return array Array of boxes
*/ */
static function listBoxes($db, $mode, $zone, $user, $excludelist=array()) static function listBoxes($db, $mode, $zone, $user=null, $excludelist=array())
{ {
global $conf; global $conf;

View File

@ -32,7 +32,7 @@ if( (array) $linked_resources && count($linked_resources) > 0)
print '<div class="tagtd">'.$langs->trans('Resource').'</div>'; print '<div class="tagtd">'.$langs->trans('Resource').'</div>';
print '<div class="tagtd">'.$langs->trans('Busy').'</div>'; print '<div class="tagtd">'.$langs->trans('Busy').'</div>';
print '<div class="tagtd">'.$langs->trans('Mandatory').'</div>'; print '<div class="tagtd">'.$langs->trans('Mandatory').'</div>';
print '<div class="tagtd">'.$langs->trans('Edit').'</div>'; print '<div class="tagtd">'.$langs->trans('Action').'</div>';
print '</form>'; print '</form>';
//print '</div>'; //print '</div>';
@ -86,8 +86,13 @@ if( (array) $linked_resources && count($linked_resources) > 0)
print '</div>'; print '</div>';
print '<div class="tagtd">'; print '<div class="tagtd">';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete_resource&element='.$element.'&element_id='.$element_id.'&lineid='.$linked_resource['rowid'].'">'.$langs->trans('Delete').'</a>'; print '<a href="'.$_SERVER['PHP_SELF'].'?mode=edit&resource_type='.$linked_resource['resource_type'].'&element='.$element.'&element_id='.$element_id.'&lineid='.$linked_resource['rowid'].'">';
print '<a href="'.$_SERVER['PHP_SELF'].'?mode=edit&resource_type='.$linked_resource['resource_type'].'&element='.$element.'&element_id='.$element_id.'&lineid='.$linked_resource['rowid'].'">'.$langs->trans('Edit').'</a>'; print img_edit();
print '</a>';
print '&nbsp;';
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete_resource&element='.$element.'&element_id='.$element_id.'&lineid='.$linked_resource['rowid'].'">';
print img_delete();
print '</a>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';

View File

@ -107,7 +107,7 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement']))
$res = $object->update_num($_POST['num_paiement']); $res = $object->update_num($_POST['num_paiement']);
if ($res === 0) if ($res === 0)
{ {
$setEventMessage($langs->trans('PaymentNumberUpdateSucceeded')); setEventMessage($langs->trans('PaymentNumberUpdateSucceeded'));
} }
else else
{ {

View File

@ -1810,13 +1810,13 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinput
$ret=''; $ret='';
$ret.='<form action="'.$urlaction.'" method="post">'; $ret.='<form action="'.$urlaction.'" method="post">';
$ret.='<label for="'.$htmlinputname.'">';
$ret.='<div class="menu_titre menu_titre_search">'; $ret.='<div class="menu_titre menu_titre_search">';
$ret.='<label for="'.$htmlinputname.'">';
$ret.='<a class="vsmenu" href="'.$urlobject.'">'; $ret.='<a class="vsmenu" href="'.$urlobject.'">';
$ret.=$title; $ret.=$title;
$ret.='</a>'; $ret.='</a>';
$ret.='</div>';
$ret.='</label>'; $ret.='</label>';
$ret.='</div>';
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$ret.='<input type="hidden" name="mode" value="search">'; $ret.='<input type="hidden" name="mode" value="search">';
$ret.='<input type="hidden" name="mode_search" value="'.$htmlmodesearch.'">'; $ret.='<input type="hidden" name="mode_search" value="'.$htmlmodesearch.'">';

View File

@ -1419,7 +1419,7 @@ else
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="2">';
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); print ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
} else { } else {
print $object->getLibStatut(2,0); print $object->getLibStatut(2,0);
@ -1428,7 +1428,7 @@ else
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="2">';
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); print ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
} else { } else {
print $object->getLibStatut(2,1); print $object->getLibStatut(2,1);
@ -1438,7 +1438,7 @@ else
// Batch number management (to batch) // Batch number management (to batch)
if ($conf->productbatch->enabled) { if ($conf->productbatch->enabled) {
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Lot").')</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Lot").')</td><td colspan="2">';
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($object, 'status_batch', 'tobatch', 'ProductStatusOnBatch', 'ProductStatusNotOnBatch'); print ajax_object_onoff($object, 'status_batch', 'tobatch', 'ProductStatusOnBatch', 'ProductStatusNotOnBatch');
} else { } else {
print $object->getLibStatut(2,2); print $object->getLibStatut(2,2);

View File

@ -511,7 +511,7 @@ else
$product_static->status = $objp->tosell; $product_static->status = $objp->tosell;
// Status (to sell) // Status (to sell)
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); print ajax_object_onoff($product_static, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
} else { } else {
print $product_static->LibStatut($objp->tosell,5,0); print $product_static->LibStatut($objp->tosell,5,0);
@ -520,7 +520,7 @@ else
// Status (to buy) // Status (to buy)
print '<td align="center" nowrap="nowrap">'; print '<td align="center" nowrap="nowrap">';
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); print ajax_object_onoff($product_static, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
} else { } else {
print $product_static->LibStatut($objp->tobuy,5,1); print $product_static->LibStatut($objp->tobuy,5,1);

View File

@ -279,7 +279,7 @@ if ($id > 0 || $ref)
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($product, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); print ajax_object_onoff($product, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
} else { } else {
print $product->getLibStatut(2,0); print $product->getLibStatut(2,0);
@ -288,7 +288,7 @@ if ($id > 0 || $ref)
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="2">';
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) { if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($product, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); print ajax_object_onoff($product, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy');
} else { } else {
print $product->getLibStatut(2,1); print $product->getLibStatut(2,1);

View File

@ -400,11 +400,11 @@ if ($id > 0 || ! empty($ref))
// Contributor // Contributor
print '<td class="nowrap">'; print '<td class="nowrap">';
print img_object('','user'); print img_object('','user','class="hideonsmartphone"');
$contactsoftask=$object->getListContactId('internal'); $contactsoftask=$object->getListContactId('internal');
if (count($contactsoftask)>0) { if (count($contactsoftask)>0) {
$userid=$contactsoftask[0]; $userid=$contactsoftask[0];
$form->select_users($userid,'userid',0,'',0,'',$contactsoftask); print $form->select_dolusers($userid,'userid',0,'',0,'',$contactsoftask);
}else { }else {
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
} }
@ -506,7 +506,7 @@ if ($id > 0 || ! empty($ref))
$contactsoftask[]=$task_time->fk_user; $contactsoftask[]=$task_time->fk_user;
} }
if (count($contactsoftask)>0) { if (count($contactsoftask)>0) {
$form->select_users($task_time->fk_user,'userid_line',0,'',0,'',$contactsoftask); print $form->select_dolusers($task_time->fk_user,'userid_line',0,'',0,'',$contactsoftask);
}else { }else {
print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime'); print img_error($langs->trans('FirstAddRessourceToAllocateTime')).$langs->trans('FirstAddRessourceToAllocateTime');
} }

View File

@ -32,7 +32,7 @@ if (! $res) die("Include of main fails");
require_once 'class/resource.class.php'; require_once 'class/resource.class.php';
require_once 'class/html.formresource.class.php'; require_once 'class/html.formresource.class.php';
// Load traductions files requiredby by page // Load traductions files required by page
$langs->load("resource"); $langs->load("resource");
$langs->load("companies"); $langs->load("companies");
$langs->load("other"); $langs->load("other");
@ -41,6 +41,7 @@ $langs->load("resource@resource");
// Get parameters // Get parameters
$id = GETPOST('id','int'); $id = GETPOST('id','int');
$action = GETPOST('action','alpha'); $action = GETPOST('action','alpha');
$cancel = GETPOST('cancel','alpha');
if (empty($sortorder)) $sortorder="DESC"; if (empty($sortorder)) $sortorder="DESC";
if (empty($sortfield)) $sortfield="t.rowid"; if (empty($sortfield)) $sortfield="t.rowid";
if (empty($arch)) $arch = 0; if (empty($arch)) $arch = 0;
@ -64,6 +65,8 @@ if ($user->societe_id > 0)
$object = new Resource($db); $object = new Resource($db);
if ($action == 'confirm_add_resource') if ($action == 'confirm_add_resource')
{
if (! $cancel)
{ {
$error=''; $error='';
@ -106,11 +109,16 @@ if ($action == 'confirm_add_resource')
$action = ''; $action = '';
} }
} }
else
{
Header("Location: list.php");
}
}
/*************************************************** /*
* VIEW * View
* *
****************************************************/ */
$form=new Form($db); $form=new Form($db);
$formresource = new FormResource($db); $formresource = new FormResource($db);
@ -161,8 +169,10 @@ if ( !$action )
print '</table>'; print '</table>';
echo '<div style="text-align: center">', echo '<br><div align="center">',
' <input type="submit" class="button" name="" value="'.$langs->trans('Save').'" />', '<input type="submit" class="button" name="add" value="'.$langs->trans('Save').'" />',
'&nbsp;',
'<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'" />',
'</div>'; '</div>';
print '</form>'; print '</form>';

View File

@ -171,7 +171,7 @@ if ( $object->fetch($id) > 0 )
} }
else else
{ {
// Confirmation suppression resource line // Confirm deleting resource line
if ($action == 'delete') if ($action == 'delete')
{ {
print $form->formconfirm("card.php?&id=".$id,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResource"),"confirm_delete_resource",'','',1); print $form->formconfirm("card.php?&id=".$id,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResource"),"confirm_delete_resource",'','',1);
@ -228,9 +228,9 @@ if ( $object->fetch($id) > 0 )
print '</div>'; print '</div>';
} }
} }
if ($action != "delete" ) if ($action != "delete" && $action != "edit")
{ {
// Edit resource // Delete resource
if($user->rights->resource->delete) if($user->rights->resource->delete)
{ {
print '<div class="inline-block divButAction">'; print '<div class="inline-block divButAction">';

View File

@ -1,6 +1,5 @@
<?php <?php
/* Module to manage locations, buildings, floors and rooms into Dolibarr ERP/CRM /* Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2013 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -32,7 +31,7 @@ require 'class/resource.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Load traductions files requiredby by page // Load traductions files requiredby by page
$langs->load("resource@resource"); $langs->load("resource");
$langs->load("other"); $langs->load("other");
// Get parameters // Get parameters
@ -70,8 +69,9 @@ $resource_id = GETPOST('fk_resource','int');
$resource_type = GETPOST('resource_type','alpha'); $resource_type = GETPOST('resource_type','alpha');
$busy = GETPOST('busy','int'); $busy = GETPOST('busy','int');
$mandatory = GETPOST('mandatory','int'); $mandatory = GETPOST('mandatory','int');
$cancel = GETPOST('cancel','alpha');
if($action == 'add_element_resource' && !GETPOST('cancel')) if($action == 'add_element_resource' && ! $cancel)
{ {
$objstat = fetchObjectByElement($element_id,$element); $objstat = fetchObjectByElement($element_id,$element);
$res = $objstat->add_element_resource($resource_id,$resource_type,$busy,$mandatory); $res = $objstat->add_element_resource($resource_id,$resource_type,$busy,$mandatory);
@ -251,9 +251,6 @@ else
foreach ($object->available_resources as $modresources => $resources) foreach ($object->available_resources as $modresources => $resources)
{ {
$langs->load($resources);
//print '<h2>'.$modresources.'</h2>';
$resources=(array) $resources; // To be sure $resources is an array $resources=(array) $resources; // To be sure $resources is an array
foreach($resources as $resource_obj) foreach($resources as $resource_obj)
{ {
@ -301,7 +298,7 @@ else
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
print '<div class="inline-block divButAction">'; print '<div class="inline-block divButAction">';
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?mode=add&resource_type='.$resource_obj.'&element='.$element.'&element_id='.$element_id.'">Add resource</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?mode=add&resource_type='.$resource_obj.'&element='.$element.'&element_id='.$element_id.'">'.$langs->trans('AddResource').'</a>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';
} }

View File

@ -1,6 +1,5 @@
<?php <?php
/* Module to manage resources into Dolibarr ERP/CRM /* Copyright (C) 2013-2014 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2013-2014 Jean-François Ferry <jfefe@aternatik.fr>
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -116,7 +115,7 @@ else
print_liste_field_titre($langs->trans('Id'),$_SERVER['PHP_SELF'],'t.rowid','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Id'),$_SERVER['PHP_SELF'],'t.rowid','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'t.ref','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'t.ref','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('ResourceType'),$_SERVER['PHP_SELF'],'ty.code','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('ResourceType'),$_SERVER['PHP_SELF'],'ty.code','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Edit')); print_liste_field_titre($langs->trans('Action'),"","","","",'width="60" align="center"',"","");
print '</tr>'; print '</tr>';
foreach ($object->lines as $resource) foreach ($object->lines as $resource)
@ -128,7 +127,7 @@ else
$style='style="background: orange;"'; $style='style="background: orange;"';
print '<tr '.$bc[$var].' '.$style.'><td>'; print '<tr '.$bc[$var].' '.$style.'><td>';
print $resource->id; print '<a href="./card.php?id='.$resource->id.'">'.$resource->id.'</a>';
print '</td>'; print '</td>';
print '<td>'; print '<td>';
@ -139,9 +138,14 @@ else
print $resource->type_label; print $resource->type_label;
print '</td>'; print '</td>';
print '<td>'; print '<td align="center">';
print '<a href="card.php?id='.$resource->id.'">'.$langs->trans('View').'</a> '; print '<a href="./card.php?action=update&id='.$resource->id.'">';
print '<a href="card.php?action=edit&id='.$resource->id.'">'.$langs->trans('Edit').'</a>'; print img_edit();
print '</a>';
print '&nbsp;';
print '<a href="./card.php?action=delete&id='.$resource->id.'">';
print img_delete();
print '</a>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';

View File

@ -1727,7 +1727,7 @@ else
// Status // Status
print '<tr><td>'.$langs->trans("Status").'</td>'; print '<tr><td>'.$langs->trans("Status").'</td>';
print '<td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'">'; print '<td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'">';
if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer) { if (! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
print ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased'); print ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
} else { } else {
print $object->getLibStatut(2); print $object->getLibStatut(2);

View File

@ -88,10 +88,11 @@ if ($id > 0 || ! empty($ref))
{ {
$result = $object->fetch($id, $ref); $result = $object->fetch($id, $ref);
$upload_dir = $conf->user->multidir_output[$object->entity] . "/" . $object->id ; $entitytouseforuserdir = $object->entity;
if (empty($entitytouseforuserdir)) $entitytouseforuserdir=1;
$upload_dir = $conf->user->multidir_output[$entitytouseforuserdir] . "/" . $object->id ;
} }
/* /*
* Actions * Actions
*/ */
@ -159,8 +160,8 @@ if ($object->id)
print '</div>'; print '</div>';
$modulepart = 'societe'; $modulepart = 'user';
$permission = $user->rights->societe->creer; $permission = $user->rights->user->user->creer;
$param = '&id=' . $object->id; $param = '&id=' . $object->id;
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
} }

View File

@ -29,6 +29,7 @@ set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
require_once '../master.inc.php'; require_once '../master.inc.php';
require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP require_once NUSOAP_PATH.'/nusoap.php'; // Include SOAP
require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
@ -84,14 +85,7 @@ $server->wsdl->addComplexType(
) )
); );
// Define other specific objects $line_fields = array(
$server->wsdl->addComplexType(
'line',
'complexType',
'struct',
'all',
'',
array(
'id' => array('name'=>'id','type'=>'xsd:string'), 'id' => array('name'=>'id','type'=>'xsd:string'),
'type' => array('name'=>'type','type'=>'xsd:int'), 'type' => array('name'=>'type','type'=>'xsd:int'),
'fk_commande' => array('name'=>'fk_commande','type'=>'xsd:int'), 'fk_commande' => array('name'=>'fk_commande','type'=>'xsd:int'),
@ -117,7 +111,34 @@ $server->wsdl->addComplexType(
'product_ref' => array('name'=>'product_ref','type'=>'xsd:string'), 'product_ref' => array('name'=>'product_ref','type'=>'xsd:string'),
'product_label' => array('name'=>'product_label','type'=>'xsd:string'), 'product_label' => array('name'=>'product_label','type'=>'xsd:string'),
'product_desc' => array('name'=>'product_desc','type'=>'xsd:string') 'product_desc' => array('name'=>'product_desc','type'=>'xsd:string')
) );
//Retreive all extrafield for thirdsparty
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('commandedet',true);
if (count($extrafields)>0) {
$extrafield_line_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
{
//$value=$object->array_options["options_".$key];
$type =$extrafields->attribute_type[$key];
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
else {$type='xsd:string';}
$extrafield_line_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
}
$line_fields=array_merge($line_fields,$extrafield_line_array);
// Define other specific objects
$server->wsdl->addComplexType(
'line',
'complexType',
'struct',
'all',
'',
$line_fields
); );
/*$server->wsdl->addComplexType( /*$server->wsdl->addComplexType(
@ -151,13 +172,7 @@ $server->wsdl->addComplexType(
) )
); );
$server->wsdl->addComplexType( $order_fields = array(
'order',
'complexType',
'struct',
'all',
'',
array(
'id' => array('name'=>'id','type'=>'xsd:string'), 'id' => array('name'=>'id','type'=>'xsd:string'),
'ref' => array('name'=>'ref','type'=>'xsd:string'), 'ref' => array('name'=>'ref','type'=>'xsd:string'),
'ref_client' => array('name'=>'ref_client','type'=>'xsd:string'), 'ref_client' => array('name'=>'ref_client','type'=>'xsd:string'),
@ -196,8 +211,34 @@ $server->wsdl->addComplexType(
'demand_reason_id' => array('name'=>'demand_reason_id','type'=>'xsd:string'), 'demand_reason_id' => array('name'=>'demand_reason_id','type'=>'xsd:string'),
'lines' => array('name'=>'lines','type'=>'tns:LinesArray2') 'lines' => array('name'=>'lines','type'=>'tns:LinesArray2')
)
); );
//Retreive all extrafield for thirdsparty
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('commande',true);
if (count($extrafields)>0) {
$extrafield_array = array();
}
foreach($extrafields->attribute_label as $key=>$label)
{
//$value=$object->array_options["options_".$key];
$type =$extrafields->attribute_type[$key];
if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';}
else {$type='xsd:string';}
$extrafield_array['options_'.$key]=array('name'=>'options_'.$key,'type'=>$type);
}
$order_fields=array_merge($order_fields,$extrafield_array);
$server->wsdl->addComplexType(
'order',
'complexType',
'struct',
'all',
'',
$order_fields
);
/* /*
$server->wsdl->addComplexType( $server->wsdl->addComplexType(
'OrdersArray', 'OrdersArray',
@ -644,6 +685,16 @@ function createOrder($authentication,$order)
$newobject->demand_reason_id=$order['demand_reason_id']; $newobject->demand_reason_id=$order['demand_reason_id'];
$newobject->date_creation=$now; $newobject->date_creation=$now;
// Retrieve all extrafield for order
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('commandet',true);
foreach($extrafields->attribute_label as $key=>$label)
{
$key='options_'.$key;
$newobject->array_options[$key]=$order[$key];
}
// Trick because nusoap does not store data with same structure if there is one or several lines // Trick because nusoap does not store data with same structure if there is one or several lines
$arrayoflines=array(); $arrayoflines=array();
if (isset($order['lines']['line'][0])) $arrayoflines=$order['lines']['line']; if (isset($order['lines']['line'][0])) $arrayoflines=$order['lines']['line'];
@ -666,6 +717,17 @@ function createOrder($authentication,$order)
$newline->total_ttc=$line['total']; $newline->total_ttc=$line['total'];
$newline->date_start=$line['date_start']; $newline->date_start=$line['date_start'];
$newline->date_end=$line['date_end']; $newline->date_end=$line['date_end'];
// Retrieve all extrafield for lines
// fetch optionals attributes and labels
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('commandedet',true);
foreach($extrafields->attribute_label as $key=>$label)
{
$key='options_'.$key;
$newline->array_options[$key]=$line[$key];
}
$newobject->lines[]=$newline; $newobject->lines[]=$newline;
} }