Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop6 Conflicts: htdocs/core/photos_resize.php htdocs/install/mysql/data/llx_c_action_trigger.sql
This commit is contained in:
commit
ba7ca3da6e
@ -45,7 +45,7 @@ if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
// Filter
|
||||
$year = $_GET["year"];
|
||||
$year = GETPOST('year', 'int');
|
||||
if ($year == 0) {
|
||||
$year_current = strftime("%Y", time());
|
||||
$year_start = $year_current;
|
||||
|
||||
@ -1164,7 +1164,7 @@ else
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td><td><input type="text" name="phone_perso" size="20" value="'.(isset($_POST["phone_perso"])?GETPOST("phone_perso"):$object->phone_perso).'"></td></tr>';
|
||||
|
||||
// Mobile phone
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?GETPOST("hone_mobile"):$object->phone_mobile).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td><td><input type="text" name="phone_mobile" size="20" value="'.(isset($_POST["phone_mobile"])?GETPOST("phone_mobile"):$object->phone_mobile).'"></td></tr>';
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
|
||||
@ -375,7 +375,7 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
|
||||
print '<td align="center"> </td>'."\n";
|
||||
print '<td align="right" class="nowrap">'."\n";
|
||||
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", '', 0, 1);
|
||||
$formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1);
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
||||
|
||||
@ -112,7 +112,12 @@ $modules=array(
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_EXPENSEREPORTS',
|
||||
'img' => 'trip'
|
||||
)
|
||||
),
|
||||
/* TODO Enable this
|
||||
array(
|
||||
'code' => 'MAIN_DELAY_EXPENSEREPORTS_TO_PAY',
|
||||
'img' => 'trip'
|
||||
)*/
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@ -404,7 +404,7 @@ if ($action == 'edit')
|
||||
$var=!$var;
|
||||
$liste = array();
|
||||
$liste['user'] = $langs->trans('UserEmail');
|
||||
$liste['company'] = $langs->trans('CompanyEmail');
|
||||
$liste['company'] = $langs->trans('CompanyEmail').' ('.(empty($conf->global->MAIN_INFO_SOCIETE_MAIL)?$langs->trans("NotDefined"):$conf->global->MAIN_INFO_SOCIETE_MAIL).')';
|
||||
|
||||
print '<tr '.$bc[$var?1:0].'><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td><td>';
|
||||
print $form->selectarray('MAIN_MAIL_DEFAULT_FROMTYPE',$liste,$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE,0);
|
||||
|
||||
@ -49,8 +49,8 @@ class Categorie extends CommonObject
|
||||
const TYPE_MEMBER = 3; // TODO Replace this value with 'member'
|
||||
const TYPE_CONTACT = 4; // TODO Replace this value with 'contact'
|
||||
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
|
||||
const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account'
|
||||
const TYPE_PROJECT = 6;
|
||||
const TYPE_ACCOUNT = 5; // for bank account TODO Replace this value with 'account'
|
||||
const TYPE_PROJECT = 6;
|
||||
|
||||
/**
|
||||
* @var array ID mapping from type string
|
||||
@ -131,17 +131,17 @@ class Categorie extends CommonObject
|
||||
public $element='category';
|
||||
public $table_element='categories';
|
||||
|
||||
var $fk_parent;
|
||||
var $label;
|
||||
var $description;
|
||||
public $fk_parent;
|
||||
public $label;
|
||||
public $description;
|
||||
/**
|
||||
* @var string Color
|
||||
*/
|
||||
var $color;
|
||||
public $color;
|
||||
/**
|
||||
* @var ???
|
||||
*/
|
||||
var $socid;
|
||||
public $socid;
|
||||
/**
|
||||
* @var int Category type
|
||||
*
|
||||
@ -154,10 +154,10 @@ class Categorie extends CommonObject
|
||||
* @see Categorie::TYPE_ACCOUNT
|
||||
* @see Categorie::TYPE_PROJECT
|
||||
*/
|
||||
var $type;
|
||||
public $type;
|
||||
|
||||
var $cats=array(); // Categories table in memory
|
||||
var $motherof=array();
|
||||
public $cats = array(); // Categories table in memory
|
||||
public $motherof = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -681,9 +681,9 @@ if ($action == 'create')
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat" name="titre" size="40" value="'.$_POST['titre'].'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat" name="errorsto" size="40" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO)?$conf->global->MAILING_EMAIL_ERRORSTO:$conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat minwidth200" name="titre" value="'.dol_escape_htmltag(GETPOST('titre')).'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO)?$conf->global->MAILING_EMAIL_ERRORSTO:$conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
@ -697,7 +697,7 @@ if ($action == 'create')
|
||||
print '</br><br>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTopic").'</td><td><input class="flat" name="sujet" size="60" value="'.$_POST['sujet'].'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTopic").'</td><td><input class="flat minwidth200" name="sujet" value="'.dol_escape_htmltag(GETPOST('sujet')).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("BackgroundColorByDefault").'</td><td colspan="3">';
|
||||
print $htmlother->selectColor($_POST['bgcolor'],'bgcolor','new_mailing',0);
|
||||
print '</td></tr>';
|
||||
@ -756,11 +756,12 @@ else
|
||||
$sendingmode=$conf->global->MAIN_MAIL_SENDMODE;
|
||||
if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function
|
||||
|
||||
// Note: MAILING_LIMIT_SENDBYWEB is always defined to something != 0
|
||||
// MAILING_NO_USING_PHPMAIL may be defined or not
|
||||
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0, MAILING_LIMIT_SENDBYCLI may be defined ot not.
|
||||
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
|
||||
{
|
||||
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
|
||||
// You ensure that every user is using its own SMTP server.
|
||||
// You ensure that every user is using its own SMTP server when using the mass emailing module.
|
||||
$linktoadminemailbefore='<a href="'.DOL_URL_ROOT.'/admin/mails.php">';
|
||||
$linktoadminemailend='</a>';
|
||||
setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings');
|
||||
@ -770,10 +771,13 @@ else
|
||||
}
|
||||
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
|
||||
{
|
||||
// No limit was defined, so the feature is forbidden from GUI, we show just a message.
|
||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
|
||||
|
||||
// The feature is forbidden from GUI, we show just message to use from command line.
|
||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||
setEventMessages('<textarea cols="60" rows="'.ROWS_1.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', null, 'warnings');
|
||||
if ($conf->file->mailing_limit_sendbyweb != '-1')
|
||||
if ($conf->file->mailing_limit_sendbyweb != '-1') // MAILING_LIMIT_SENDBYWEB was set to -1 in database, but it is allowed ot increase it.
|
||||
{
|
||||
setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings'); // You can send online with constant...
|
||||
}
|
||||
@ -781,8 +785,11 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
$text='';
|
||||
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
|
||||
|
||||
$text='';
|
||||
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
|
||||
{
|
||||
$text.=$langs->trans("MailingNeedCommand");
|
||||
$text.='<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.' '.$user->login.'</textarea>';
|
||||
|
||||
@ -1015,6 +1015,18 @@ if (empty($reshook))
|
||||
if (! $error) {
|
||||
$db->begin();
|
||||
|
||||
if (empty($user->rights->margins->creer))
|
||||
{
|
||||
foreach ($object->lines as &$line)
|
||||
{
|
||||
if ($line->id == GETPOST('lineid'))
|
||||
{
|
||||
$fournprice = $line->fk_fournprice;
|
||||
$buyingprice = $line->pa_ht;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $object->updateline(GETPOST('lineid'), $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, $_POST["units"], $pu_ht_devise);
|
||||
|
||||
if ($result >= 0) {
|
||||
|
||||
@ -116,7 +116,7 @@ if ($socid > 0)
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Remise
|
||||
// Discount
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("CustomerRelativeDiscount").'</td><td>'.price2num($object->remise_percent)."%</td></tr>";
|
||||
|
||||
@ -127,13 +127,13 @@ if ($socid > 0)
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Nouvelle valeur
|
||||
// New value
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("NewValue").'</td><td><input type="text" size="5" name="remise" value="'.($_POST["remise"]?$_POST["remise"]:'').'">%</td></tr>';
|
||||
print $langs->trans("NewValue").'</td><td><input type="text" size="5" name="remise" value="'.dol_escape_htmltag(GETPOST("remise")).'">%</td></tr>';
|
||||
|
||||
// Motif/Note
|
||||
print '<tr><td>';
|
||||
print $langs->trans("NoteReason").'</td><td><input type="text" size="60" name="note" value="'.$_POST["note"].'"></td></tr>';
|
||||
print $langs->trans("NoteReason").'</td><td><input type="text" size="60" name="note" value="'.dol_escape_htmltag(GETPOST("note")).'"></td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
|
||||
@ -968,6 +968,19 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
|
||||
if (empty($user->rights->margins->creer))
|
||||
{
|
||||
foreach ($object->lines as &$line)
|
||||
{
|
||||
if ($line->id == GETPOST('lineid'))
|
||||
{
|
||||
$fournprice = $line->fk_fournprice;
|
||||
$buyingprice = $line->pa_ht;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $object->updateline(GETPOST('lineid'), $description, $pu_ht, GETPOST('qty'), GETPOST('remise_percent'), $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'),$pu_ht_devise);
|
||||
|
||||
if ($result >= 0) {
|
||||
|
||||
@ -58,9 +58,6 @@ llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES
|
||||
$object->fetch_thirdparty();
|
||||
$object->info($object->id);
|
||||
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($object->thirdparty->id);
|
||||
|
||||
$head = commande_prepare_head($object);
|
||||
dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), 0, 'order');
|
||||
|
||||
@ -68,13 +65,12 @@ dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), 0, 'order');
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
|
||||
@ -71,11 +71,10 @@ $form = new Form($db);
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($object->socid);
|
||||
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$head = commande_prepare_head($object);
|
||||
|
||||
|
||||
dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), 0, 'order');
|
||||
|
||||
// Order card
|
||||
@ -88,7 +87,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
|
||||
@ -576,7 +576,7 @@ if ($resql)
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
print '<input type="hidden" name="ref" value="'.$ref.'">';
|
||||
if (! empty($_REQUEST['bid'])) print '<input type="hidden" name="bid" value="'.$_REQUEST["bid"].'">';
|
||||
if (GETPOST('bid')) print '<input type="hidden" name="bid" value="'.GETPOST("bid").'">';
|
||||
|
||||
// Form to reconcile
|
||||
if ($user->rights->banque->consolidate && $action == 'reconcile')
|
||||
|
||||
@ -50,7 +50,7 @@ $cancel = GETPOST('cancel', 'alpha');
|
||||
// Security check
|
||||
if (isset($_GET["id"]) || isset($_GET["ref"]))
|
||||
{
|
||||
$id = isset($_GET["id"])?$_GET["id"]:(isset($_GET["ref"])?$_GET["ref"]:'');
|
||||
$id = isset($_GET["id"])?GETPOST("id"):(isset($_GET["ref"])?GETPOST("ref"):'');
|
||||
}
|
||||
$fieldid = isset($_GET["ref"])?'ref':'rowid';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
@ -93,7 +93,7 @@ if ($action == 'add')
|
||||
$object->iban = trim($_POST["iban"]);
|
||||
$object->domiciliation = trim($_POST["domiciliation"]);
|
||||
|
||||
$object->proprio = trim($_POST["proprio"]);
|
||||
$object->proprio = trim($_POST["proprio"]);
|
||||
$object->owner_address = trim($_POST["owner_address"]);
|
||||
|
||||
$account_number = GETPOST('account_number','alpha');
|
||||
@ -105,12 +105,12 @@ if ($action == 'add')
|
||||
|
||||
$object->currency_code = trim($_POST["account_currency_code"]);
|
||||
|
||||
$object->state_id = $_POST["account_state_id"];
|
||||
$object->state_id = $_POST["account_state_id"];
|
||||
$object->country_id = $_POST["account_country_id"];
|
||||
|
||||
$object->min_allowed = GETPOST("account_min_allowed",'int');
|
||||
$object->min_desired = GETPOST("account_min_desired",'int');
|
||||
$object->comment = trim($_POST["account_comment"]);
|
||||
$object->comment = trim(GETPOST("account_comment"));
|
||||
|
||||
$object->fk_user_author = $user->id;
|
||||
|
||||
@ -172,7 +172,7 @@ if ($action == 'update')
|
||||
|
||||
// Update account
|
||||
$object = new Account($db);
|
||||
$object->fetch($_POST["id"]);
|
||||
$object->fetch(GETPOST("id"));
|
||||
|
||||
$object->ref = dol_string_nospecial(trim($_POST["ref"]));
|
||||
$object->label = trim($_POST["label"]);
|
||||
@ -190,7 +190,7 @@ if ($action == 'update')
|
||||
$object->iban = trim($_POST["iban"]);
|
||||
$object->domiciliation = trim($_POST["domiciliation"]);
|
||||
|
||||
$object->proprio = trim($_POST["proprio"]);
|
||||
$object->proprio = trim($_POST["proprio"]);
|
||||
$object->owner_address = trim($_POST["owner_address"]);
|
||||
|
||||
$account_number = GETPOST('account_number', 'int');
|
||||
@ -204,7 +204,7 @@ if ($action == 'update')
|
||||
|
||||
$object->min_allowed = GETPOST("account_min_allowed",'int');
|
||||
$object->min_desired = GETPOST("account_min_desired",'int');
|
||||
$object->comment = trim($_POST["account_comment"]);
|
||||
$object->comment = trim(GETPOST("account_comment"));
|
||||
|
||||
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED && empty($object->account_number))
|
||||
{
|
||||
@ -251,7 +251,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user-
|
||||
{
|
||||
// Delete
|
||||
$object = new Account($db);
|
||||
$object->fetch($_GET["id"]);
|
||||
$object->fetch(GETPOST("id","int"));
|
||||
$object->delete();
|
||||
|
||||
header("Location: ".DOL_URL_ROOT."/compta/bank/index.php");
|
||||
@ -367,7 +367,7 @@ if ($action == 'create')
|
||||
|
||||
// Web
|
||||
print '<tr><td>'.$langs->trans("Web").'</td>';
|
||||
print '<td colspan="3"><input size="50" type="text" class="flat" name="url" value="'.$_POST["url"].'"></td></tr>';
|
||||
print '<td colspan="3"><input class="minwidth300" type="text" class="flat" name="url" value="'.GETPOST("url").'"></td></tr>';
|
||||
|
||||
// Tags-Categories
|
||||
if ($conf->categorie->enabled)
|
||||
@ -836,11 +836,11 @@ else
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
||||
print '<td><input size="8" type="text" class="flat" name="ref" value="'.(isset($_POST["ref"])?$_POST["ref"]:$object->ref).'"></td></tr>';
|
||||
print '<td><input size="8" type="text" class="flat" name="ref" value="'.(isset($_POST["ref"])?GETPOST("ref"):$object->ref).'"></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||
print '<td><input type="text" class="flat minwidth300" name="label" value="'.(isset($_POST["label"])?$_POST["label"]:$object->label).'"></td></tr>';
|
||||
print '<td><input type="text" class="flat minwidth300" name="label" value="'.(isset($_POST["label"])?GETPOST("label"):$object->label).'"></td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||
@ -902,14 +902,14 @@ else
|
||||
|
||||
// Balance
|
||||
print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
||||
print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(isset($_POST["account_min_allowed"])?$_POST["account_min_allowed"]:$object->min_allowed).'"></td></tr>';
|
||||
print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(isset($_POST["account_min_allowed"])?GETPOST("account_min_allowed"):$object->min_allowed).'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
|
||||
print '<td ><input size="12" type="text" class="flat" name="account_min_desired" value="'.(isset($_POST["account_min_desired"])?$_POST["account_min_desired"]:$object->min_desired).'"></td></tr>';
|
||||
print '<td ><input size="12" type="text" class="flat" name="account_min_desired" value="'.(isset($_POST["account_min_desired"])?GETPOST("account_min_desired"):$object->min_desired).'"></td></tr>';
|
||||
|
||||
// Web
|
||||
print '<tr><td>'.$langs->trans("Web").'</td>';
|
||||
print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(isset($_POST["url"])?$_POST["url"]:$object->url).'">';
|
||||
print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(isset($_POST["url"])?GETPOST("url"):$object->url).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Tags-Categories
|
||||
@ -970,7 +970,7 @@ else
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
|
||||
print '<td><input type="text" name="accountancy_journal" value="'.(isset($_POST["accountancy_journal"])?$_POST["accountancy_journal"]:$object->accountancy_journal).'"></td></tr>';
|
||||
print '<td><input type="text" name="accountancy_journal" value="'.(isset($_POST["accountancy_journal"])?GETPOST("accountancy_journal"):$object->accountancy_journal).'"></td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -833,7 +833,7 @@ class Account extends CommonObject
|
||||
* @param string $ref Ref of bank account to get
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id,$ref='')
|
||||
function fetch($id, $ref='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
@ -43,9 +43,9 @@ $fieldid = isset($_GET["ref"])?'ref':'rowid';
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'banque',$id,'bank_account&bank_account','','',$fieldid);
|
||||
|
||||
$account=$_GET["account"];
|
||||
$account=GETPOST("account");
|
||||
$mode='standard';
|
||||
if (isset($_GET["mode"]) && $_GET["mode"] == 'showalltime') $mode='showalltime';
|
||||
if (GETPOST("mode") == 'showalltime') $mode='showalltime';
|
||||
$error=0;
|
||||
|
||||
|
||||
@ -63,18 +63,18 @@ $datetime = dol_now();
|
||||
$year = dol_print_date($datetime, "%Y");
|
||||
$month = dol_print_date($datetime, "%m");
|
||||
$day = dol_print_date($datetime, "%d");
|
||||
if (! empty($_GET["year"])) $year=sprintf("%04d",$_GET["year"]);
|
||||
if (! empty($_GET["month"])) $month=sprintf("%02d",$_GET["month"]);
|
||||
if (GETPOST("year")) $year=sprintf("%04d",GETPOST("year"));
|
||||
if (GETPOST("month")) $month=sprintf("%02d",GETPOST("month"));
|
||||
|
||||
|
||||
$object = new Account($db);
|
||||
if ($_GET["account"] && ! preg_match('/,/',$_GET["account"])) // if for a particular account and not a list
|
||||
{
|
||||
$result=$object->fetch($_GET["account"]);
|
||||
$result=$object->fetch(GETPOST("account", "int"));
|
||||
}
|
||||
if ($_GET["ref"])
|
||||
{
|
||||
$result=$object->fetch(0,$_GET["ref"]);
|
||||
$result=$object->fetch(0, GETPOST("ref"));
|
||||
$account=$object->id;
|
||||
}
|
||||
|
||||
@ -823,7 +823,7 @@ print '<br><br></td></tr>';
|
||||
// Graphs
|
||||
if ($mode == 'standard')
|
||||
{
|
||||
$prevyear=$year;$nextyear=$year;
|
||||
$prevyear=$year; $nextyear=$year;
|
||||
$prevmonth=$month-1;$nextmonth=$month+1;
|
||||
if ($prevmonth < 1) { $prevmonth=12; $prevyear--; }
|
||||
if ($nextmonth > 12) { $nextmonth=1; $nextyear++; }
|
||||
|
||||
@ -97,35 +97,36 @@ $sql.= " AND s.entity IN (".getEntity('societe', 1).")";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if (dol_strlen($stcomm))
|
||||
{
|
||||
$sql.= " AND s.fk_stcomm=$stcomm";
|
||||
$sql.= " AND s.fk_stcomm=".$stcomm;
|
||||
}
|
||||
if ($socname)
|
||||
{
|
||||
$sql.= " AND s.nom LIKE '%".$db->escape($socname)."%'";
|
||||
$sql.= natural_search("s.nom", $socname);
|
||||
$sortfield = "s.nom";
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
if ($_GET["search_nom"])
|
||||
{
|
||||
$sql.= " AND s.nom LIKE '%".$db->escape($_GET["search_nom"])."%'";
|
||||
$sql.= natural_search("s.nom", GETPOST("search_nom"));
|
||||
}
|
||||
if ($_GET["search_compta"])
|
||||
{
|
||||
$sql.= " AND s.code_compta LIKE '%".$db->escape($_GET["search_compta"])."%'";
|
||||
$sql.= natural_search("s.code_compta", GETPOST("search_compta"));
|
||||
}
|
||||
if ($_GET["search_code_client"])
|
||||
{
|
||||
$sql.= " AND s.code_client LIKE '%".$db->escape($_GET["search_code_client"])."%'";
|
||||
$sql.= natural_search("s.code_client", GETPOST("search_code_client"));
|
||||
}
|
||||
if (dol_strlen($begin))
|
||||
{
|
||||
$sql.= " AND s.nom LIKE '".$db->escape($begin)."'";
|
||||
$sql.= natural_search("s.nom", $begin);
|
||||
}
|
||||
if ($socid)
|
||||
{
|
||||
$sql.= " AND s.rowid = ".$socid;
|
||||
}
|
||||
$sql.= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
|
||||
$sql.= " ORDER BY $sortfield $sortorder ";
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
//print $sql;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -1688,6 +1688,19 @@ if (empty($reshook))
|
||||
|
||||
// Update line
|
||||
if (! $error) {
|
||||
if (empty($user->rights->margins->creer))
|
||||
{
|
||||
foreach ($object->lines as &$line)
|
||||
{
|
||||
if ($line->id == GETPOST('lineid'))
|
||||
{
|
||||
$fournprice = $line->fk_fournprice;
|
||||
$buyingprice = $line->pa_ht;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = $object->updateline(GETPOST('lineid'), $description, $pu_ht, $qty, GETPOST('remise_percent'),
|
||||
$date_start, $date_end, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $type,
|
||||
GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('progress'),
|
||||
|
||||
@ -66,12 +66,12 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
$datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
|
||||
$datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
|
||||
|
||||
$localtax->accountid=$_POST["accountid"];
|
||||
$localtax->paymenttype=$_POST["paiementtype"];
|
||||
$localtax->accountid=GETPOST("accountid");
|
||||
$localtax->paymenttype=GETPOST("paiementtype");
|
||||
$localtax->datev=$datev;
|
||||
$localtax->datep=$datep;
|
||||
$localtax->amount=$_POST["amount"];
|
||||
$localtax->label=$_POST["label"];
|
||||
$localtax->amount=price2num(GETPOST("amount"));
|
||||
$localtax->label=GETPOST("label");
|
||||
$localtax->ltt=$lttype;
|
||||
|
||||
$ret=$localtax->addPayment($user);
|
||||
@ -178,10 +178,10 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input name="label" size="40" value="'.($_POST["label"]?$_POST["label"]:$langs->transcountry(($lttype==2?"LT2Payment":"LT1Payment"),$mysoc->country_code)).'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input name="label" class="minwidth200" value="'.($_POST["label"]?GETPOST("label",'',2):$langs->transcountry(($lttype==2?"LT2Payment":"LT1Payment"),$mysoc->country_code)).'"></td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.$_POST["amount"].'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.GETPOST("amount").'"></td></tr>';
|
||||
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
|
||||
@ -251,9 +251,9 @@ if (empty($reshook))
|
||||
$paiement->datepaye = $datepaye;
|
||||
$paiement->amounts = $amounts; // Array with all payments dispatching
|
||||
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
|
||||
$paiement->paiementid = dol_getIdFromCode($db,$_POST['paiementcode'],'c_paiement');
|
||||
$paiement->num_paiement = $_POST['num_paiement'];
|
||||
$paiement->note = $_POST['comment'];
|
||||
$paiement->paiementid = dol_getIdFromCode($db,GETPOST('paiementcode'),'c_paiement');
|
||||
$paiement->num_paiement = GETPOST('num_paiement');
|
||||
$paiement->note = GETPOST('comment');
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
@ -513,7 +513,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
// Comments
|
||||
print '<tr><td>'.$langs->trans('Comments').'</td>';
|
||||
print '<td valign="top">';
|
||||
print '<textarea name="comment" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.(empty($_POST['comment'])?'':$_POST['comment']).'</textarea></td></tr>';
|
||||
print '<textarea name="comment" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.GETPOST('comment').'</textarea></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -683,12 +683,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
if (!empty($conf->use_javascript_ajax))
|
||||
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
|
||||
print '<input type=hidden class="remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
|
||||
print '<input type="text" size="8" class="amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
print '<input type="text" size="8" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
|
||||
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.dol_escape_htmltag(GETPOST($namef)).'" disabled>';
|
||||
print '<input type="hidden" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ if ($user->societe_id > 0)
|
||||
$dir = $conf->facture->dir_output.'/payments';
|
||||
if (! $user->rights->societe->client->voir || $socid) $dir.='/private/'.$user->id; // If user has no permission to see all, output dir is specific to user
|
||||
|
||||
$year = $_GET["year"];
|
||||
$year = GETPOST('year', 'int');
|
||||
if (! $year) { $year=date("Y"); }
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ $langs->load('banks');
|
||||
$langs->load('companies');
|
||||
|
||||
// Security check
|
||||
$id=GETPOST("id");
|
||||
$id=GETPOST("id",'int');
|
||||
$action=GETPOST("action");
|
||||
$confirm=GETPOST('confirm');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
@ -126,12 +126,12 @@ $form = new Form($db);
|
||||
|
||||
$h=0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$_GET["id"];
|
||||
$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$id;
|
||||
$head[$h][1] = $langs->trans("Card");
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
|
||||
/*$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$_GET["id"];
|
||||
/*$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$id;
|
||||
$head[$h][1] = $langs->trans("Info");
|
||||
$h++;
|
||||
*/
|
||||
|
||||
@ -257,7 +257,7 @@ if ($action == 'create')
|
||||
// Label
|
||||
print '<tr><td>';
|
||||
print fieldLabel('Label','label',1).'</td><td>';
|
||||
print '<input name="label" id="label" size="40" value="'.($_POST["label"]?$_POST["label"]:$langs->trans("SalaryPayment")).'">';
|
||||
print '<input name="label" id="label" class="minwidth300" value="'.($_POST["label"]?GETPOST("label",'',2):$langs->trans("SalaryPayment")).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start period
|
||||
@ -275,7 +275,7 @@ if ($action == 'create')
|
||||
// Amount
|
||||
print '<tr><td>';
|
||||
print fieldLabel('Amount','amount',1).'</td><td>';
|
||||
print '<input name="amount" id="amount" size="10" value="'.GETPOST("amount").'">';
|
||||
print '<input name="amount" id="amount" class="minwidth100" value="'.GETPOST("amount").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank
|
||||
|
||||
@ -39,7 +39,7 @@ $userid=GETPOST('userid','int');
|
||||
$socid = GETPOST('socid','int');
|
||||
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
|
||||
$modecompta = $conf->global->ACCOUNTING_MODE;
|
||||
if ($_GET["modecompta"]) $modecompta=$_GET["modecompta"];
|
||||
if (GETPOST("modecompta")) $modecompta=GETPOST("modecompta",'alpha');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||
|
||||
@ -258,10 +258,10 @@ if ($action == 'create')
|
||||
} else {
|
||||
$label = $langs->trans("VATPayment");
|
||||
}
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input name="label" id="label" size="40" value="'.($_POST["label"]?$_POST["label"]:$label).'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="minwidth300" name="label" id="label" value="'.($_POST["label"]?GETPOST("label",'',2):$label).'"></td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.$_POST["amount"].'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.GETPOST("amount").'"></td></tr>';
|
||||
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
|
||||
$year=$_GET["year"];
|
||||
$year = GETPOST('year', 'int');
|
||||
if ($year == 0 )
|
||||
{
|
||||
$year_current = strftime("%Y",time());
|
||||
|
||||
297
htdocs/contact/agenda.php
Normal file
297
htdocs/contact/agenda.php
Normal file
@ -0,0 +1,297 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/contact/card.php
|
||||
* \ingroup societe
|
||||
* \brief Card of a contact
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT. '/core/class/html.form.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("users");
|
||||
$langs->load("other");
|
||||
$langs->load("commercial");
|
||||
|
||||
$mesg=''; $error=0; $errors=array();
|
||||
|
||||
$action = (GETPOST('action','alpha') ? GETPOST('action','alpha') : 'view');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
$backtopage = GETPOST('backtopage','alpha');
|
||||
$id = GETPOST('id','int');
|
||||
$socid = GETPOST('socid','int');
|
||||
|
||||
$object = new Contact($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$object->getCanvas($id);
|
||||
$objcanvas=null;
|
||||
$canvas = (! empty($object->canvas)?$object->canvas:GETPOST("canvas"));
|
||||
if (! empty($canvas))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
|
||||
$objcanvas = new Canvas($db, $action);
|
||||
$objcanvas->getCanvas('contact', 'contactcard', $canvas);
|
||||
}
|
||||
|
||||
if (GETPOST('actioncode','array'))
|
||||
{
|
||||
$actioncode=GETPOST('actioncode','array',3);
|
||||
if (! count($actioncode)) $actioncode='0';
|
||||
}
|
||||
else
|
||||
{
|
||||
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE));
|
||||
}
|
||||
$search_agenda_label=GETPOST('search_agenda_label');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='a.datep, a.id';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('contactcard','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$parameters=array('id'=>$id, 'objcanvas'=>$objcanvas);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Cancel
|
||||
if (GETPOST("cancel") && ! empty($backtopage))
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$actioncode='';
|
||||
$search_agenda_label='';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/contactnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->lastname) $title=$object->lastname;
|
||||
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$form = new Form($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
$countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
|
||||
|
||||
if ($socid > 0)
|
||||
{
|
||||
$objsoc = new Societe($db);
|
||||
$objsoc->fetch($socid);
|
||||
}
|
||||
|
||||
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
{
|
||||
// -----------------------------------------
|
||||
// When used with CANVAS
|
||||
// -----------------------------------------
|
||||
if (empty($object->error) && $id)
|
||||
{
|
||||
$object = new Contact($db);
|
||||
$result=$object->fetch($id);
|
||||
if ($result <= 0) dol_print_error('',$object->error);
|
||||
}
|
||||
$objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates
|
||||
$objcanvas->display_canvas($action); // Show template
|
||||
}
|
||||
else
|
||||
{
|
||||
// -----------------------------------------
|
||||
// When used in standard mode
|
||||
// -----------------------------------------
|
||||
|
||||
// Confirm deleting contact
|
||||
if ($user->rights->societe->contact->supprimer)
|
||||
{
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id.($backtopage?'&backtopage='.$backtopage:''),$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Onglets
|
||||
*/
|
||||
$head=array();
|
||||
if ($id > 0)
|
||||
{
|
||||
// Si edition contact deja existant
|
||||
$object = new Contact($db);
|
||||
$res=$object->fetch($id, $user);
|
||||
if ($res < 0) { dol_print_error($db,$object->error); exit; }
|
||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
||||
|
||||
// Show tabs
|
||||
$head = contact_prepare_head($object);
|
||||
|
||||
$title = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
}
|
||||
|
||||
if (! empty($id) && $action != 'edit' && $action != 'create')
|
||||
{
|
||||
$objsoc = new Societe($db);
|
||||
|
||||
/*
|
||||
* Fiche en mode visualisation
|
||||
*/
|
||||
|
||||
dol_htmloutput_errors($error,$errors);
|
||||
|
||||
dol_fiche_head($head, 'agenda', $title, 0, 'contact');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
$objsoc=new Societe($db);
|
||||
$objsoc->fetch($object->socid);
|
||||
// Thirdparty
|
||||
$morehtmlref.=$langs->trans('ThirdParty') . ' : ';
|
||||
if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
$object->info($id);
|
||||
print dol_print_object_info($object, 1);
|
||||
|
||||
print '</div>';
|
||||
|
||||
print dol_fiche_end();
|
||||
|
||||
|
||||
// Actions buttons
|
||||
|
||||
$objcon=$object;
|
||||
$object->fetch_thirdparty();
|
||||
$objthirdparty=$object->thirdparty;
|
||||
|
||||
$out='';
|
||||
$permok=$user->rights->agenda->myactions->create;
|
||||
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
|
||||
{
|
||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objthirdparty) == 'Societe') $out.='&socid='.$objthirdparty->id;
|
||||
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=-1';
|
||||
//$out.=$langs->trans("AddAnAction").' ';
|
||||
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||
//$out.="</a>";
|
||||
}
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
if (! empty($user->rights->agenda->myactions->create) || ! empty($user->rights->agenda->allactions->create))
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||
{
|
||||
$param='&id='.$id;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("TasksHistoryForThisContact"),'','');
|
||||
|
||||
// List of all actions
|
||||
$filters=array();
|
||||
$filters['search_agenda_label']=$search_agenda_label;
|
||||
|
||||
show_actions_done($conf,$langs,$db,$objthirdparty,$object,0,$actioncode, '', $filters, $sortfield, $sortorder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@ -477,10 +477,10 @@ else
|
||||
*/
|
||||
$object->canvas=$canvas;
|
||||
|
||||
$object->state_id = $_POST["state_id"];
|
||||
$object->state_id = GETPOST("state_id");
|
||||
|
||||
// We set country_id, country_code and label for the selected country
|
||||
$object->country_id=$_POST["country_id"]?$_POST["country_id"]:(empty($objsoc->country_id)?$mysoc->country_id:$objsoc->country_id);
|
||||
$object->country_id=$_POST["country_id"]?GETPOST("country_id"):(empty($objsoc->country_id)?$mysoc->country_id:$objsoc->country_id);
|
||||
if ($object->country_id)
|
||||
{
|
||||
$tmparray=getCountry($object->country_id,'all');
|
||||
@ -530,9 +530,9 @@ else
|
||||
|
||||
// Name
|
||||
print '<tr><td class="titlefieldcreate fieldrequired"><label for="lastname">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</label></td>';
|
||||
print '<td><input name="lastname" id="lastname" type="text" size="30" maxlength="80" value="'.dol_escape_htmltag(GETPOST("lastname")?GETPOST("lastname"):$object->lastname).'" autofocus="autofocus"></td>';
|
||||
print '<td><input name="lastname" id="lastname" type="text" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("lastname")?GETPOST("lastname"):$object->lastname).'" autofocus="autofocus"></td>';
|
||||
print '<td><label for="firstname">'.$langs->trans("Firstname").'</label></td>';
|
||||
print '<td><input name="firstname" id="firstname"type="text" size="30" maxlength="80" value="'.dol_escape_htmltag(GETPOST("firstname")?GETPOST("firstname"):$object->firstname).'"></td></tr>';
|
||||
print '<td><input name="firstname" id="firstname"type="text" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("firstname")?GETPOST("firstname"):$object->firstname).'"></td></tr>';
|
||||
|
||||
// Company
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
@ -559,7 +559,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td><label for="title">'.$langs->trans("PostOrFunction").'</label></td>';
|
||||
print '<td colspan="3"><input name="poste" id="title" type="text" size="50" maxlength="80" value="'.dol_escape_htmltag(GETPOST("poste",'alpha')?GETPOST("poste",'alpha'):$object->poste).'"></td>';
|
||||
print '<td colspan="3"><input name="poste" id="title" type="text" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("poste",'alpha')?GETPOST("poste",'alpha'):$object->poste).'"></td>';
|
||||
|
||||
$colspan=3;
|
||||
if ($conf->use_javascript_ajax && $socid > 0) $colspan=2;
|
||||
@ -612,20 +612,20 @@ else
|
||||
// Phone / Fax
|
||||
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) $object->phone_pro = $objsoc->phone; // Predefined with third party
|
||||
print '<tr><td><label for="phone_pro">'.$langs->trans("PhonePro").'</label></td>';
|
||||
print '<td><input name="phone_pro" id="phone_pro" type="text" size="18" maxlength="80" value="'.dol_escape_htmltag(GETPOST("phone_pro")?GETPOST("phone_pro"):$object->phone_pro).'"></td>';
|
||||
print '<td><input name="phone_pro" id="phone_pro" type="text" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("phone_pro")?GETPOST("phone_pro"):$object->phone_pro).'"></td>';
|
||||
print '<td><label for="phone_perso">'.$langs->trans("PhonePerso").'</label></td>';
|
||||
print '<td><input name="phone_perso" id="phone_perso" type="text" size="18" maxlength="80" value="'.dol_escape_htmltag(GETPOST("phone_perso")?GETPOST("phone_perso"):$object->phone_perso).'"></td></tr>';
|
||||
print '<td><input name="phone_perso" id="phone_perso" type="text" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("phone_perso")?GETPOST("phone_perso"):$object->phone_perso).'"></td></tr>';
|
||||
|
||||
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->fax)) == 0) $object->fax = $objsoc->fax; // Predefined with third party
|
||||
print '<tr><td><label for="phone_mobile">'.$langs->trans("PhoneMobile").'</label></td>';
|
||||
print '<td><input name="phone_mobile" id="phone_mobile" type="text" size="18" maxlength="80" value="'.dol_escape_htmltag(GETPOST("phone_mobile")?GETPOST("phone_mobile"):$object->phone_mobile).'"></td>';
|
||||
print '<td><input name="phone_mobile" id="phone_mobile" type="text" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("phone_mobile")?GETPOST("phone_mobile"):$object->phone_mobile).'"></td>';
|
||||
print '<td><label for="fax">'.$langs->trans("Fax").'</label></td>';
|
||||
print '<td><input name="fax" id="fax" type="text" size="18" maxlength="80" value="'.dol_escape_htmltag(GETPOST("fax",'alpha')?GETPOST("fax",'alpha'):$object->fax).'"></td></tr>';
|
||||
print '<td><input name="fax" id="fax" type="text" class="minwidth100" maxlength="80" value="'.dol_escape_htmltag(GETPOST("fax",'alpha')?GETPOST("fax",'alpha'):$object->fax).'"></td></tr>';
|
||||
|
||||
// EMail
|
||||
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party
|
||||
print '<tr><td><label for="email">'.$langs->trans("Email").'</label></td>';
|
||||
print '<td><input name="email" id="email" type="text" size="50" maxlength="80" value="'.(GETPOST("email",'alpha')?GETPOST("email",'alpha'):$object->email).'"></td>';
|
||||
print '<td><input name="email" id="email" type="text" class="minwidth200" maxlength="80" value="'.(GETPOST("email",'alpha')?GETPOST("email",'alpha'):$object->email).'"></td>';
|
||||
if (! empty($conf->mailing->enabled))
|
||||
{
|
||||
print '<td><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
||||
@ -639,13 +639,13 @@ else
|
||||
|
||||
// Instant message and no email
|
||||
print '<tr><td><label for="jabberid">'.$langs->trans("IM").'</label></td>';
|
||||
print '<td colspan="3"><input name="jabberid" id="jabberid" type="text" size="50" maxlength="80" value="'.(GETPOST("jabberid",'alpha')?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
|
||||
print '<td colspan="3"><input name="jabberid" id="jabberid" type="text" class="minwidth100" maxlength="80" value="'.(GETPOST("jabberid",'alpha')?GETPOST("jabberid",'alpha'):$object->jabberid).'"></td></tr>';
|
||||
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<tr><td><label for="skype">'.$langs->trans("Skype").'</label></td>';
|
||||
print '<td colspan="3"><input name="skype" id="skype" type="text" size="50" maxlength="80" value="'.(GETPOST("skype",'alpha')?GETPOST("skype",'alpha'):$object->skype).'"></td></tr>';
|
||||
print '<td colspan="3"><input name="skype" id="skype" type="text" class="minwidth100" maxlength="80" value="'.(GETPOST("skype",'alpha')?GETPOST("skype",'alpha'):$object->skype).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
@ -784,9 +784,13 @@ else
|
||||
|
||||
// Lastname
|
||||
print '<tr><td class="titlefieldcreate fieldrequired"><label for="lastname">'.$langs->trans("Lastname").' / '.$langs->trans("Label").'</label></td>';
|
||||
print '<td><input name="lastname" id="lastname" type="text" size="20" maxlength="80" value="'.(isset($_POST["lastname"])?$_POST["lastname"]:$object->lastname).'" autofocus="autofocus"></td>';
|
||||
print '<td colspan="3"><input name="lastname" id="lastname" type="text" class="minwidth200" maxlength="80" value="'.(isset($_POST["lastname"])?GETPOST("lastname"):$object->lastname).'" autofocus="autofocus"></td>';
|
||||
print '</tr>';
|
||||
print '<tr>';
|
||||
// Firstname
|
||||
print '<td><label for="firstname">'.$langs->trans("Firstname").'</label></td>';
|
||||
print '<td><input name="firstname" id="firstname" type="text" size="20" maxlength="80" value="'.(isset($_POST["firstname"])?$_POST["firstname"]:$object->firstname).'"></td></tr>';
|
||||
print '<td colspan="3"><input name="firstname" id="firstname" type="text" class="minwidth200" maxlength="80" value="'.(isset($_POST["firstname"])?GETPOST("firstname"):$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Company
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
@ -800,57 +804,56 @@ else
|
||||
|
||||
// Civility
|
||||
print '<tr><td><label for="civility_id">'.$langs->trans("UserTitle").'</label></td><td colspan="3">';
|
||||
print $formcompany->select_civility(isset($_POST["civility_id"])?$_POST["civility_id"]:$object->civility_id);
|
||||
print $formcompany->select_civility(isset($_POST["civility_id"])?GETPOST("civility_id"):$object->civility_id);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td><label for="title">'.$langs->trans("PostOrFunction").'</label></td>';
|
||||
print '<td colspan="3"><input name="poste" id="title" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>';
|
||||
print '<td colspan="3"><input name="poste" id="title" type="text" class="minwidth100" maxlength="80" value="'.(isset($_POST["poste"])?GETPOST("poste"):$object->poste).'"></td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td><label for="address">'.$langs->trans("Address").'</label></td>';
|
||||
print '<td colspan="2"><textarea class="flat" name="address" id="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
|
||||
|
||||
$rowspan=3;
|
||||
if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++;
|
||||
|
||||
print '<td valign="middle" align="center" rowspan="'.$rowspan.'">';
|
||||
if ($conf->use_javascript_ajax) print '<a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a>';
|
||||
print '</td></tr>';
|
||||
print '<td colspan="3">';
|
||||
print '<div class="paddingrightonly valignmiddle inline-block">';
|
||||
print '<textarea class="flat minwidth200" name="address" id="address">'.(isset($_POST["address"])?GETPOST("address"):$object->address).'</textarea>';
|
||||
print '</div><div class="paddingrightonly valignmiddle inline-block">';
|
||||
if ($conf->use_javascript_ajax) print '<a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a><br>';
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td><label for="zipcode">'.$langs->trans("Zip").'</label> / <label for="town">'.$langs->trans("Town").'</label></td><td colspan="2" class="maxwidthonsmartphone">';
|
||||
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' ';
|
||||
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$object->town),'town',array('zipcode','selectcountry_id','state_id'));
|
||||
print '<tr><td><label for="zipcode">'.$langs->trans("Zip").'</label> / <label for="town">'.$langs->trans("Town").'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
||||
print $formcompany->select_ziptown((isset($_POST["zipcode"])?GETPOST("zipcode"):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6).' ';
|
||||
print $formcompany->select_ziptown((isset($_POST["town"])?GETPOST("town"):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
print '<tr><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td colspan="2" class="maxwidthonsmartphone">';
|
||||
print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id');
|
||||
print '<tr><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
||||
print $form->select_country(isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id,'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
if (empty($conf->global->SOCIETE_DISABLE_STATE))
|
||||
{
|
||||
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="2" class="maxwidthonsmartphone">';
|
||||
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'state_id');
|
||||
print '<tr><td><label for="state_id">'.$langs->trans('State').'</label></td><td colspan="3" class="maxwidthonsmartphone">';
|
||||
print $formcompany->select_state($object->state_id,isset($_POST["country_id"])?GETPOST("country_id"):$object->country_id,'state_id');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Phone
|
||||
print '<tr><td><label for="phone_pro">'.$langs->trans("PhonePro").'</label></td>';
|
||||
print '<td><input name="phone_pro" id="phone_pro" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_pro"])?$_POST["phone_pro"]:$object->phone_pro).'"></td>';
|
||||
print '<td><input name="phone_pro" id="phone_pro" type="text" class="flat maxwidthonsmartphone" maxlength="80" value="'.(isset($_POST["phone_pro"])?GETPOST("phone_pro"):$object->phone_pro).'"></td>';
|
||||
print '<td><label for="phone_perso">'.$langs->trans("PhonePerso").'</label></td>';
|
||||
print '<td><input name="phone_perso" id="phone_perso" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_perso"])?$_POST["phone_perso"]:$object->phone_perso).'"></td></tr>';
|
||||
print '<td><input name="phone_perso" id="phone_perso" type="text" class="flat maxwidthonsmartphone" maxlength="80" value="'.(isset($_POST["phone_perso"])?GETPOST("phone_perso"):$object->phone_perso).'"></td></tr>';
|
||||
|
||||
print '<tr><td><label for="phone_mobile">'.$langs->trans("PhoneMobile").'</label></td>';
|
||||
print '<td><input name="phone_mobile" id="phone_mobile" type="text" size="18" maxlength="80" value="'.(isset($_POST["phone_mobile"])?$_POST["phone_mobile"]:$object->phone_mobile).'"></td>';
|
||||
print '<td><input name="phone_mobile" id="phone_mobile" class="flat maxwidthonsmartphone" type="text" maxlength="80" value="'.(isset($_POST["phone_mobile"])?GETPOST("phone_mobile"):$object->phone_mobile).'"></td>';
|
||||
print '<td><label for="fax">'.$langs->trans("Fax").'</label></td>';
|
||||
print '<td><input name="fax" id="fax" type="text" size="18" maxlength="80" value="'.(isset($_POST["fax"])?$_POST["fax"]:$object->fax).'"></td></tr>';
|
||||
print '<td><input name="fax" id="fax" type="text" class="flat maxwidthonsmartphone" maxlength="80" value="'.(isset($_POST["fax"])?GETPOST("fax"):$object->fax).'"></td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td><label for="email">'.$langs->trans("EMail").'</label></td>';
|
||||
print '<td><input name="email" id="email" type="text" size="40" maxlength="80" value="'.(isset($_POST["email"])?$_POST["email"]:$object->email).'"></td>';
|
||||
print '<td><input name="email" id="email" type="text" class="flat maxwidthonsmartphone" maxlength="80" value="'.(isset($_POST["email"])?GETPOST("email"):$object->email).'"></td>';
|
||||
if (! empty($conf->mailing->enabled))
|
||||
{
|
||||
$langs->load("mails");
|
||||
@ -865,7 +868,7 @@ else
|
||||
|
||||
// Jabberid
|
||||
print '<tr><td><label for="jabberid">'.$langs->trans("IM").'</label></td>';
|
||||
print '<td><input name="jabberid" id="jabberid" type="text" size="40" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>';
|
||||
print '<td><input name="jabberid" id="jabberid" type="text" class="minwidth100" maxlength="80" value="'.(isset($_POST["jabberid"])?$_POST["jabberid"]:$object->jabberid).'"></td>';
|
||||
if (! empty($conf->mailing->enabled))
|
||||
{
|
||||
print '<td><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
|
||||
@ -881,7 +884,7 @@ else
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<tr><td><label for="skype">'.$langs->trans("Skype").'</label></td>';
|
||||
print '<td><input name="skype" id="skype" type="text" size="40" maxlength="80" value="'.(isset($_POST["skype"])?$_POST["skype"]:$object->skype).'"></td></tr>';
|
||||
print '<td><input name="skype" id="skype" type="text" class="minwidth100" maxlength="80" value="'.(isset($_POST["skype"])?GETPOST("skype"):$object->skype).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
@ -1046,7 +1049,18 @@ else
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
$objsoc->fetch($object->socid);
|
||||
// Thirdparty
|
||||
$morehtmlref.=$langs->trans('ThirdParty') . ' : ';
|
||||
if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
@ -1055,24 +1069,6 @@ else
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
// Company
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
print '<tr><td class="titlefield">'.$langs->trans("ThirdParty").'</td><td>';
|
||||
if ($object->socid > 0)
|
||||
{
|
||||
$objsoc->fetch($object->socid);
|
||||
print $objsoc->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '</tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td>';
|
||||
print $object->getCivilityLabel();
|
||||
@ -1233,8 +1229,9 @@ else
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
print "<br>";
|
||||
//print "<br>";
|
||||
|
||||
/*
|
||||
if (! empty($conf->agenda->enabled))
|
||||
{
|
||||
$objthirdparty=$objsoc;
|
||||
@ -1258,6 +1255,7 @@ else
|
||||
|
||||
print show_actions_done($conf,$langs,$db,$objsoc,$object,0,'','');
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -109,7 +109,19 @@ if ($object->id)
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
$objsoc=new Societe($db);
|
||||
$objsoc->fetch($object->socid);
|
||||
// Thirdparty
|
||||
$morehtmlref.=$langs->trans('ThirdParty') . ' : ';
|
||||
if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
@ -117,6 +129,7 @@ if ($object->id)
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Company
|
||||
/*
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
if ($object->socid > 0)
|
||||
@ -133,7 +146,7 @@ if ($object->id)
|
||||
print $langs->trans("ContactNotLinkedToCompany");
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Civility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
||||
|
||||
@ -74,25 +74,31 @@ if ($id > 0)
|
||||
$head = contact_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'note', $title,0,'contact');
|
||||
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
$objsoc=new Societe($db);
|
||||
$objsoc->fetch($object->socid);
|
||||
// Thirdparty
|
||||
$morehtmlref.=$langs->trans('ThirdParty') . ' : ';
|
||||
if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
$cssclass='titlefield';
|
||||
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
|
||||
//if ($action == 'editnote_private') $cssclass='titlefieldcreate';
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Company
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
@ -148,13 +154,13 @@ if ($id > 0)
|
||||
|
||||
print "</table>";
|
||||
|
||||
//print '<div>';
|
||||
print '<br>';
|
||||
|
||||
//print '<br>';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
$cssclass="titlefield";
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
@ -233,7 +233,20 @@ else
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||
$morehtmlref='<div class="refidno">';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
$objsoc=new Societe($db);
|
||||
$objsoc->fetch($object->socid);
|
||||
// Thirdparty
|
||||
$morehtmlref.=$langs->trans('ThirdParty') . ' : ';
|
||||
if ($objsoc->id > 0) $morehtmlref.=$objsoc->getNomUrl(1);
|
||||
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
@ -242,6 +255,7 @@ else
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Company
|
||||
/*
|
||||
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
|
||||
{
|
||||
if ($object->socid > 0)
|
||||
@ -258,7 +272,7 @@ else
|
||||
print $langs->trans("ContactNotLinkedToCompany");
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Civility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
|
||||
|
||||
@ -51,8 +51,8 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
|
||||
{
|
||||
// Increase date
|
||||
$al = new AccountLine($db);
|
||||
$al->datev_next($_GET["rowid"]);
|
||||
$al->fetch($_GET["rowid"]);
|
||||
$al->datev_next(GETPOST('rowid','int'));
|
||||
$al->fetch(GETPOST('rowid','int'));
|
||||
|
||||
print '<span>'.dol_print_date($db->jdate($al->datev),"day").'</span>';
|
||||
|
||||
@ -63,8 +63,8 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
|
||||
{
|
||||
// Decrease date
|
||||
$al =new AccountLine($db);
|
||||
$al->datev_previous($_GET["rowid"]);
|
||||
$al->fetch($_GET["rowid"]);
|
||||
$al->datev_previous(GETPOST('rowid','int'));
|
||||
$al->fetch(GETPOST('rowid','int'));
|
||||
|
||||
print '<span>'.dol_print_date($db->jdate($al->datev),"day").'</span>';
|
||||
|
||||
|
||||
@ -54,6 +54,7 @@ class CMailFile
|
||||
var $deliveryreceipt;
|
||||
|
||||
var $eol;
|
||||
var $eol2;
|
||||
var $atleastonefile=0;
|
||||
var $error='';
|
||||
|
||||
@ -103,7 +104,7 @@ class CMailFile
|
||||
* @param string $errors_to Email for errors-to
|
||||
* @param string $css Css option
|
||||
* @param string $trackid Tracking string
|
||||
* @param string $moreinheader More in header (for phpmail only for the moment)
|
||||
* @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'phpmail' and 'smtps' for the moment)
|
||||
*/
|
||||
function __construct($subject,$to,$from,$msg,$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='',$trackid='',$moreinheader='')
|
||||
{
|
||||
@ -117,6 +118,7 @@ class CMailFile
|
||||
{
|
||||
$this->eol="\n";
|
||||
$this->eol2="\n";
|
||||
$moreinheader = str_replace("\r\n","\n",$moreinheader);
|
||||
}
|
||||
|
||||
// On defini mixed_boundary
|
||||
@ -152,6 +154,8 @@ class CMailFile
|
||||
$this->msgishtml = $msgishtml;
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
||||
|
||||
// Detect images
|
||||
if ($this->msgishtml)
|
||||
{
|
||||
@ -207,7 +211,7 @@ class CMailFile
|
||||
$this->deliveryreceipt = $deliveryreceipt;
|
||||
$this->trackid = $trackid;
|
||||
$smtp_headers = $this->write_smtpheaders();
|
||||
if (! empty($moreinheader)) $smtp_headers.=$moreinheader;
|
||||
if (! empty($moreinheader)) $smtp_headers.=$moreinheader; // $moreinheader contains the \r\n
|
||||
|
||||
// Define mime_headers
|
||||
$mime_headers = $this->write_mimeheaders($filename_list, $mimefilename_list);
|
||||
@ -268,7 +272,8 @@ class CMailFile
|
||||
$smtps->setFrom($this->getValidAddress($from,0,1));
|
||||
$smtps->setTrackId($trackid);
|
||||
$smtps->setReplyTo($this->getValidAddress($from,0,1)); // Set property with this->smtps->setReplyTo after constructor if you want to use another value than the From
|
||||
|
||||
if (! empty($moreinheader)) $smtps->setMoreInHeader($moreinheader);
|
||||
|
||||
if (! empty($this->html))
|
||||
{
|
||||
if (!empty($css))
|
||||
@ -322,7 +327,8 @@ class CMailFile
|
||||
$this->phpmailer->SetFrom($this->getValidAddress($from,0,1));
|
||||
$this->phpmailer->SetReplyTo($this->getValidAddress($from,0,1)); // Set property with this->phpmailer->setReplyTo after constructor if you want to use another value than the From
|
||||
// TODO Add trackid into smtp header
|
||||
|
||||
// TODO if (! empty($moreinheader)) ...
|
||||
|
||||
if (! empty($this->html))
|
||||
{
|
||||
if (!empty($css))
|
||||
@ -375,7 +381,8 @@ class CMailFile
|
||||
$msgid = $headers->get('Message-ID');
|
||||
$msgid->setId($headerID);
|
||||
$headers->addIdHeader('References', $headerID);
|
||||
|
||||
// TODO if (! empty($moreinheader)) ...
|
||||
|
||||
// Give the message a subject
|
||||
$this->message->setSubject($this->encodetorfc2822($subject));
|
||||
|
||||
@ -456,7 +463,7 @@ class CMailFile
|
||||
*/
|
||||
function sendfile()
|
||||
{
|
||||
global $conf,$db;
|
||||
global $conf,$db,$langs;
|
||||
|
||||
$errorlevel=error_reporting();
|
||||
error_reporting($errorlevel ^ E_WARNING); // Desactive warnings
|
||||
@ -479,6 +486,30 @@ class CMailFile
|
||||
return $reshook;
|
||||
}
|
||||
|
||||
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
|
||||
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
|
||||
$tmparray = explode(',', $this->addr_to);
|
||||
if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
|
||||
{
|
||||
$this->error = 'Too much recipients in to:';
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
$tmparray = explode(',', $this->addr_cc);
|
||||
if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
|
||||
{
|
||||
$this->error = 'Too much recipients in cc:';
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
$tmparray = explode(',', $this->addr_bcc);
|
||||
if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
|
||||
{
|
||||
$this->error = 'Too much recipients in bcc:';
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Action according to choosed sending method
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||
{
|
||||
@ -507,8 +538,6 @@ class CMailFile
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'), LOG_DEBUG);
|
||||
|
||||
$bounce = ''; // By default
|
||||
if (! empty($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F))
|
||||
{
|
||||
@ -521,7 +550,8 @@ class CMailFile
|
||||
{
|
||||
$bounce .= ($bounce?' ':'').'-ba';
|
||||
}
|
||||
|
||||
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$bounce, LOG_DEBUG);
|
||||
|
||||
$this->message=stripslashes($this->message);
|
||||
|
||||
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
|
||||
@ -539,7 +569,8 @@ class CMailFile
|
||||
{
|
||||
$this->error.=" to HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'); // This values are value used only for non linuxlike systems
|
||||
}
|
||||
$this->error.=".<br>Check your server logs and your firewalls setup";
|
||||
$this->error.=".<br>";
|
||||
$this->error.=$langs->trans("ErrorPhpMailDelivery");
|
||||
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
|
||||
}
|
||||
else
|
||||
@ -942,8 +973,9 @@ class CMailFile
|
||||
$strContent = preg_replace("/\r\n/si", "\n", $strContent);
|
||||
}
|
||||
|
||||
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems bugged
|
||||
$strContent = rtrim(wordwrap($strContent));
|
||||
// Make RFC2045 Compliant, split lines
|
||||
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
|
||||
$strContent = rtrim(wordwrap($strContent)); // TODO Using this method creates unexpected line break on text/plain content.
|
||||
|
||||
if ($this->msgishtml)
|
||||
{
|
||||
|
||||
@ -586,9 +586,10 @@ abstract class CommonDocGenerator
|
||||
{
|
||||
if (strlen($object->array_options['options_'.$key])>0)
|
||||
{
|
||||
$object->array_options['options_'.$key] = dol_print_date($object->array_options['options_'.$key],'day'); // using company output language
|
||||
$object->array_options['options_'.$key.'_locale'] = dol_print_date($object->array_options['options_'.$key],'day','tzserver',$outputlangs); // using output language format
|
||||
$object->array_options['options_'.$key.'_rfc'] = dol_print_date($object->array_options['options_'.$key],'dayrfc'); // international format
|
||||
$date = $object->array_options['options_'.$key];
|
||||
$object->array_options['options_'.$key] = dol_print_date($date,'day'); // using company output language
|
||||
$object->array_options['options_'.$key.'_locale'] = dol_print_date($date,'day','tzserver',$outputlangs); // using output language format
|
||||
$object->array_options['options_'.$key.'_rfc'] = dol_print_date($date,'dayrfc'); // international format
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -596,12 +597,17 @@ abstract class CommonDocGenerator
|
||||
$object->array_options['options_'.$key.'_locale'] = '';
|
||||
$object->array_options['options_'.$key.'_rfc'] = '';
|
||||
}
|
||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_locale' => $object->array_options['options_'.$key.'_locale']));
|
||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_rfc' => $object->array_options['options_'.$key.'_rfc']));
|
||||
}
|
||||
else if($extrafields->attribute_type[$key] == 'datetime')
|
||||
{
|
||||
$object->array_options['options_'.$key] = ($object->array_options['options_'.$key]!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhour'):''); // using company output language
|
||||
$object->array_options['options_'.$key.'_locale'] = ($object->array_options['options_'.$key]!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhour','tzserver',$outputlangs):''); // using output language format
|
||||
$object->array_options['options_'.$key.'_rfc'] = ($object->array_options['options_'.$key]!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhourrfc'):''); // international format
|
||||
$datetime = $object->array_options['options_'.$key];
|
||||
$object->array_options['options_'.$key] = ($datetime!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhour'):''); // using company output language
|
||||
$object->array_options['options_'.$key.'_locale'] = ($datetime!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhour','tzserver',$outputlangs):''); // using output language format
|
||||
$object->array_options['options_'.$key.'_rfc'] = ($datetime!="0000-00-00 00:00:00"?dol_print_date($object->array_options['options_'.$key],'dayhourrfc'):''); // international format
|
||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_locale' => $object->array_options['options_'.$key.'_locale']));
|
||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key.'_rfc' => $object->array_options['options_'.$key.'_rfc']));
|
||||
}
|
||||
$array_to_fill=array_merge($array_to_fill,array($array_key.'_options_'.$key => $object->array_options['options_'.$key]));
|
||||
}
|
||||
|
||||
@ -1307,7 +1307,7 @@ abstract class CommonObject
|
||||
$sql.= " FROM ".(empty($nodbprefix)?MAIN_DB_PREFIX:'').$this->table_element." as te";
|
||||
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2 || ($this->element != 'societe' && empty($this->isnolinkedbythird) && empty($user->rights->societe->client->voir))) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity
|
||||
if (empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc";
|
||||
$sql.= " WHERE te.".$fieldid." < '".$this->db->escape($this->ref)."'";
|
||||
$sql.= " WHERE te.".$fieldid." < '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists)
|
||||
if (empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir) $sql.= " AND sc.fk_user = " .$user->id;
|
||||
if (! empty($filter)) $sql.=" AND ".$filter;
|
||||
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2 || ($this->element != 'societe' && empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir)) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
|
||||
@ -1328,7 +1328,7 @@ abstract class CommonObject
|
||||
$sql.= " FROM ".(empty($nodbprefix)?MAIN_DB_PREFIX:'').$this->table_element." as te";
|
||||
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2 || ($this->element != 'societe' && empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir)) $sql.= ", ".MAIN_DB_PREFIX."societe as s"; // If we need to link to societe to limit select to entity
|
||||
if (empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON ".$alias.".rowid = sc.fk_soc";
|
||||
$sql.= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'";
|
||||
$sql.= " WHERE te.".$fieldid." > '".$this->db->escape($this->ref)."'"; // ->ref must always be defined (set to id if field does not exists)
|
||||
if (empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir) $sql.= " AND sc.fk_user = " .$user->id;
|
||||
if (! empty($filter)) $sql.=" AND ".$filter;
|
||||
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 2 || ($this->element != 'societe' && empty($this->isnolinkedbythird) && !$user->rights->societe->client->voir)) $sql.= ' AND te.fk_soc = s.rowid'; // If we need to link to societe to limit select to entity
|
||||
@ -3336,11 +3336,14 @@ abstract class CommonObject
|
||||
|
||||
if ($usemargins && ! empty($conf->margin->enabled) && empty($user->societe_id))
|
||||
{
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
|
||||
else
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
|
||||
if (!empty($user->rights->margins->creer))
|
||||
{
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
|
||||
else
|
||||
print '<td class="linecolmargin1 margininfos" align="right" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
}
|
||||
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
|
||||
print '<td class="linecolmargin2 margininfos" align="right" width="50">'.$langs->trans('MarginRate').'</td>';
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
|
||||
|
||||
@ -553,10 +553,13 @@ class Conf
|
||||
$this->bank->cheque->warning_delay=(isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT)?$this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT:0)*24*60*60;
|
||||
}
|
||||
if (isset($this->expensereport)) {
|
||||
$this->expensereport->approve = new stdClass();
|
||||
$this->expensereport->approve->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS)?$this->global->MAIN_DELAY_EXPENSEREPORTS:0)*24*60*60;
|
||||
$this->expensereport->payment = new stdClass();
|
||||
$this->expensereport->payment->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY)?$this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY:0)*24*60*60;
|
||||
}
|
||||
|
||||
|
||||
// For modules that want to disable top or left menu
|
||||
if (! empty($this->global->MAIN_HIDE_TOP_MENU)) $this->dol_hide_topmenu=$this->global->MAIN_HIDE_TOP_MENU;
|
||||
if (! empty($this->global->MAIN_HIDE_LEFT_MENU)) $this->dol_hide_leftmenu=$this->global->MAIN_HIDE_LEFT_MENU;
|
||||
|
||||
@ -29,22 +29,22 @@
|
||||
*/
|
||||
class DiscountAbsolute
|
||||
{
|
||||
var $db;
|
||||
var $error;
|
||||
public $db;
|
||||
public $error;
|
||||
|
||||
var $id; // Id discount
|
||||
var $fk_soc;
|
||||
var $amount_ht; //
|
||||
var $amount_tva; //
|
||||
var $amount_ttc; //
|
||||
var $tva_tx; // Vat rate
|
||||
var $fk_user; // Id utilisateur qui accorde la remise
|
||||
var $description; // Description libre
|
||||
var $datec; // Date creation
|
||||
var $fk_facture_line; // Id invoice line when a discount linked to invoice line (for absolute discounts)
|
||||
var $fk_facture; // Id invoice when a discoutn linked to invoice (for credit note)
|
||||
var $fk_facture_source; // Id facture avoir a l'origine de la remise
|
||||
var $ref_facture_source; // Ref facture avoir a l'origine de la remise
|
||||
public $id; // Id discount
|
||||
public $fk_soc;
|
||||
public $amount_ht; //
|
||||
public $amount_tva; //
|
||||
public $amount_ttc; //
|
||||
public $tva_tx; // Vat rate
|
||||
public $fk_user; // Id utilisateur qui accorde la remise
|
||||
public $description; // Description libre
|
||||
public $datec; // Date creation
|
||||
public $fk_facture_line; // Id invoice line when a discount linked to invoice line (for absolute discounts)
|
||||
public $fk_facture; // Id invoice when a discoutn linked to invoice (for credit note)
|
||||
public $fk_facture_source; // Id facture avoir a l'origine de la remise
|
||||
public $ref_facture_source; // Ref facture avoir a l'origine de la remise
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -4857,12 +4857,13 @@ class Form
|
||||
* @param int $disabled Html select box is disabled
|
||||
* @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order
|
||||
* @param string $morecss Add more class to css styles
|
||||
* @param int $addjscombo Add js combo
|
||||
* @param int $addjscombo Add js combo
|
||||
* @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set.
|
||||
* @return string HTML select string.
|
||||
* @param int $disablebademail Check if an email is found into value and if not disable and colorize entry.
|
||||
* @return string HTML select string.
|
||||
* @see multiselectarray
|
||||
*/
|
||||
static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='')
|
||||
static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@ -4907,7 +4908,10 @@ class Form
|
||||
// Translate
|
||||
if ($translate)
|
||||
{
|
||||
foreach($array as $key => $value) $array[$key]=$langs->trans($value);
|
||||
foreach($array as $key => $value)
|
||||
{
|
||||
$array[$key]=$langs->trans($value);
|
||||
}
|
||||
}
|
||||
|
||||
// Sort
|
||||
@ -4916,8 +4920,19 @@ class Form
|
||||
|
||||
foreach($array as $key => $value)
|
||||
{
|
||||
$disabled=''; $style='';
|
||||
if (! empty($disablebademail))
|
||||
{
|
||||
if (! preg_match('/<.+@.+>/', $value))
|
||||
{
|
||||
//$value=preg_replace('/'.preg_quote($a,'/').'/', $b, $value);
|
||||
$disabled=' disabled';
|
||||
$style=' class="warning"';
|
||||
}
|
||||
}
|
||||
$out.='<option value="'.$key.'"';
|
||||
if ($id != '' && $id == $key) $out.=' selected'; // To preselect a value
|
||||
$out.=$style.$disabled;
|
||||
if ($id != '' && $id == $key && ! $disabled) $out.=' selected'; // To preselect a value
|
||||
$out.='>';
|
||||
|
||||
if ($key_in_label)
|
||||
@ -4929,6 +4944,7 @@ class Form
|
||||
$selectOptionValue = dol_escape_htmltag($maxlen?dol_trunc($value,$maxlen):$value);
|
||||
if ($value == '' || $value == '-') $selectOptionValue=' ';
|
||||
}
|
||||
//var_dump($selectOptionValue);
|
||||
$out.=$selectOptionValue;
|
||||
$out.="</option>\n";
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ class FormActions
|
||||
print '<option value="'.$key.'"'.(($selected == $key && strlen($selected) == strlen($key)) || (($selected > 0 && $selected < 100) && $key == '50') ? ' selected' : '').'>'.$val.'</option>';
|
||||
if ($key == '50' && $onlyselect == 2)
|
||||
{
|
||||
print '<option value="todo"'.($selected == 'todo' ? ' selected' : '').'>'.$langs->trans("ActionUncomplete").' ('.$langs->trans("ActionRunningNotStarted")."+".$langs->trans("ActionRunningShort").')</option>';
|
||||
print '<option value="todo"'.($selected == 'todo' ? ' selected' : '').'>'.$langs->trans("ActionUncomplete").' ('.$langs->trans("ActionsToDoShort")."+".$langs->trans("ActionRunningShort").')</option>';
|
||||
}
|
||||
}
|
||||
print '</select>';
|
||||
|
||||
@ -264,6 +264,8 @@ class FormMail extends Form
|
||||
{
|
||||
$out='';
|
||||
|
||||
$disablebademails=1;
|
||||
|
||||
// Define list of attached files
|
||||
$listofpaths=array();
|
||||
$listofnames=array();
|
||||
@ -392,7 +394,15 @@ class FormMail extends Form
|
||||
}
|
||||
} else {
|
||||
$liste = array();
|
||||
$liste['user'] = $user->getFullName($langs) .' <'.$user->email.'>';
|
||||
if (empty($user->email))
|
||||
{
|
||||
$langs->load('errors');
|
||||
$liste['user'] = $user->getFullName($langs) . ' <'.$langs->trans('ErrorNoMailDefinedForThisUser').'>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$liste['user'] = $user->getFullName($langs) .' <'.$user->email.'>';
|
||||
}
|
||||
$liste['company'] = $conf->global->MAIN_INFO_SOCIETE_NOM .' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>';
|
||||
// Add also email aliases if there is one
|
||||
$listaliases=array('user_aliases'=>$user->email_aliases, 'global_aliases'=>$conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES);
|
||||
@ -413,7 +423,7 @@ class FormMail extends Form
|
||||
}
|
||||
}
|
||||
}
|
||||
$out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0);
|
||||
$out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', '', 0, '', $disablebademails);
|
||||
}
|
||||
|
||||
$out.= "</td></tr>\n";
|
||||
@ -510,7 +520,7 @@ class FormMail extends Form
|
||||
if (! empty($this->withto) && is_array($this->withto))
|
||||
{
|
||||
if (! empty($this->withtofree)) $out.= " ".$langs->trans("or")." ";
|
||||
$out.= $form->selectarray("receiver", $this->withto, GETPOST("receiver"), 1);
|
||||
$out.= $form->selectarray("receiver", $this->withto, GETPOST("receiver"), 1, 0, 0, '', 0, 0, 0, '', '', 0, '', $disablebademails);
|
||||
}
|
||||
if (isset($this->withtosocid) && $this->withtosocid > 0) // deprecated. TODO Remove this. Instead, fill withto with array before calling method.
|
||||
{
|
||||
@ -522,7 +532,7 @@ class FormMail extends Form
|
||||
$liste[$key]=$value;
|
||||
}
|
||||
if ($this->withtofree) $out.= " ".$langs->trans("or")." ";
|
||||
$out.= $form->selectarray("receiver", $liste, GETPOST("receiver"), 1);
|
||||
$out.= $form->selectarray("receiver", $liste, GETPOST("receiver"), 1, 0, 0, '', 0, 0, 0, '', '', 0, '', $disablebademails);
|
||||
}
|
||||
}
|
||||
$out.= "</td></tr>\n";
|
||||
@ -544,7 +554,7 @@ class FormMail extends Form
|
||||
if (! empty($this->withtocc) && is_array($this->withtocc))
|
||||
{
|
||||
$out.= " ".$langs->trans("or")." ";
|
||||
$out.= $form->selectarray("receivercc", $this->withtocc, GETPOST("receivercc"), 1);
|
||||
$out.= $form->selectarray("receivercc", $this->withtocc, GETPOST("receivercc"), 1, 0, 0, '', 0, 0, 0, '', '', 0, '', $disablebademails);
|
||||
}
|
||||
}
|
||||
$out.= "</td></tr>\n";
|
||||
|
||||
@ -446,7 +446,7 @@ class FormProjets
|
||||
* Build a HTML select list of element of same thirdparty to suggest to link them to project
|
||||
*
|
||||
* @param string $table_element Table of the element to update
|
||||
* @param int $socid If of thirdparty to use as filter
|
||||
* @param string $socid If of thirdparty to use as filter or 'id1,id2,...'
|
||||
* @param string $morecss More CSS
|
||||
* @param int $limitonstatus Add filters to limit length of list to opened status (for example to avoid ERR_RESPONSE_HEADERS_TOO_BIG on project/element.php page). TODO To implement
|
||||
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
||||
@ -502,7 +502,11 @@ class FormProjets
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$table_element." as t";
|
||||
if ($linkedtothirdparty) $sql.=", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE ".$projectkey." is null";
|
||||
if (! empty($socid) && $linkedtothirdparty) $sql.= " AND t.fk_soc=".$socid;
|
||||
if (! empty($socid) && $linkedtothirdparty)
|
||||
{
|
||||
if (is_numeric($socid)) $sql.= " AND t.fk_soc=".$socid;
|
||||
else $sql.= " AND t.fk_soc IN (".$socid.")";
|
||||
}
|
||||
if (! in_array($table_element, array('expensereport_det'))) $sql.= ' AND t.entity IN ('.getEntity('project',1).')';
|
||||
if ($linkedtothirdparty) $sql.=" AND s.rowid = t.fk_soc";
|
||||
if ($sqlfilter) $sql.= " AND ".$sqlfilter;
|
||||
|
||||
@ -28,30 +28,30 @@
|
||||
*/
|
||||
class Menubase
|
||||
{
|
||||
var $db; // To store db handler
|
||||
var $error; // To return error code (or message)
|
||||
var $errors=array(); // To return several error codes (or messages)
|
||||
public $db; // To store db handler
|
||||
public $error; // To return error code (or message)
|
||||
public $errors=array(); // To return several error codes (or messages)
|
||||
|
||||
var $id;
|
||||
public $id;
|
||||
|
||||
var $menu_handler;
|
||||
var $module;
|
||||
var $type;
|
||||
var $mainmenu;
|
||||
var $fk_menu;
|
||||
var $fk_mainmenu;
|
||||
var $fk_leftmenu;
|
||||
var $position;
|
||||
var $url;
|
||||
var $target;
|
||||
var $titre;
|
||||
var $langs;
|
||||
var $level;
|
||||
var $leftmenu; //<! Not used
|
||||
var $perms;
|
||||
var $enabled;
|
||||
var $user;
|
||||
var $tms;
|
||||
public $menu_handler;
|
||||
public $module;
|
||||
public $type;
|
||||
public $mainmenu;
|
||||
public $fk_menu;
|
||||
public $fk_mainmenu;
|
||||
public $fk_leftmenu;
|
||||
public $position;
|
||||
public $url;
|
||||
public $target;
|
||||
public $titre;
|
||||
public $langs;
|
||||
public $level;
|
||||
public $leftmenu; //<! Not used
|
||||
public $perms;
|
||||
public $enabled;
|
||||
public $user;
|
||||
public $tms;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -225,7 +225,8 @@ class SMTPs
|
||||
var $log = '';
|
||||
var $_errorsTo = '';
|
||||
var $_deliveryReceipt = 0;
|
||||
var $_trackId = '';
|
||||
var $_trackId = '';
|
||||
var $_moreInHeader = '';
|
||||
|
||||
|
||||
/**
|
||||
@ -261,15 +262,36 @@ class SMTPs
|
||||
}
|
||||
|
||||
/**
|
||||
* Set moreInHeader
|
||||
*
|
||||
* @param string $_val Value
|
||||
* @return void
|
||||
*/
|
||||
function setMoreInHeader($_val = '')
|
||||
{
|
||||
$this->_moreinheader = $_val;
|
||||
}
|
||||
|
||||
/**
|
||||
* get trackid
|
||||
*
|
||||
* @return string Delivery receipt
|
||||
* @return string Track id
|
||||
*/
|
||||
function getTrackId()
|
||||
{
|
||||
return $this->_trackId;
|
||||
}
|
||||
|
||||
/**
|
||||
* get moreInHeader
|
||||
*
|
||||
* @return string moreInHeader
|
||||
*/
|
||||
function getMoreInHeader()
|
||||
{
|
||||
return $this->_moreinheader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set errors to
|
||||
*
|
||||
@ -1213,7 +1235,9 @@ class SMTPs
|
||||
{
|
||||
$_header .= 'Message-ID: <' . time() . '.SMTPs@' . $host . ">\r\n";
|
||||
}
|
||||
|
||||
if ( $this->getMoreInHeader() )
|
||||
$_header .= $this->getMoreInHeader(); // Value must include the "\r\n";
|
||||
|
||||
//$_header .=
|
||||
// 'Read-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n"
|
||||
// 'Return-Receipt-To: ' . $this->getFrom( 'org' ) . "\r\n";
|
||||
@ -1227,15 +1251,16 @@ class SMTPs
|
||||
|
||||
// DOL_CHANGE LDR
|
||||
if ( $this->getDeliveryReceipt() )
|
||||
$_header .= 'Disposition-Notification-To: '.$this->getFrom('addr') . "\r\n";
|
||||
$_header .= 'Disposition-Notification-To: '.$this->getFrom('addr') . "\r\n";
|
||||
if ( $this->getErrorsTo() )
|
||||
$_header .= 'Errors-To: '.$this->getErrorsTo('addr') . "\r\n";
|
||||
$_header .= 'Errors-To: '.$this->getErrorsTo('addr') . "\r\n";
|
||||
if ( $this->getReplyTo() )
|
||||
$_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n";
|
||||
$_header .= "Reply-To: ".$this->getReplyTo('addr') ."\r\n";
|
||||
|
||||
$_header .= 'X-Mailer: Dolibarr version ' . DOL_VERSION .' (using SMTPs Mailer)' . "\r\n"
|
||||
. 'Mime-Version: 1.0' . "\r\n";
|
||||
$_header .= 'X-Mailer: Dolibarr version ' . DOL_VERSION .' (using SMTPs Mailer)' . "\r\n";
|
||||
$_header .= 'Mime-Version: 1.0' . "\r\n";
|
||||
|
||||
|
||||
return $_header;
|
||||
}
|
||||
|
||||
@ -1258,7 +1283,9 @@ class SMTPs
|
||||
// Make RFC821 Compliant, replace bare linefeeds
|
||||
$strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent);
|
||||
|
||||
$strContent = rtrim(wordwrap($strContent, 75, "\r\n"));
|
||||
// Make RFC2045 Compliant
|
||||
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
|
||||
$strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // TODO Using this method creates unexpected line break on text/plain content.
|
||||
|
||||
$this->_msgContent[$strType] = array();
|
||||
|
||||
|
||||
@ -713,12 +713,12 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
print '</td>';
|
||||
|
||||
// Address / Phone
|
||||
print '<td>';
|
||||
print '<td class="liste_titre">';
|
||||
//print '<input type="text" class="flat" name="search_addressphone" size="20" value="'.$search_addressphone.'">';
|
||||
print '</td>';
|
||||
|
||||
// Email
|
||||
print '<td> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
// Status
|
||||
print '<td class="liste_titre maxwidthonsmartphone">';
|
||||
@ -729,7 +729,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||
{
|
||||
$colspan++;
|
||||
print '<td> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
}
|
||||
|
||||
// Edit
|
||||
@ -1148,7 +1148,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
||||
$facturestatic=new Facture($db);
|
||||
|
||||
$out.='<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
$out.='<input type="hidden" name="id" value="'.$filterobj->id.'" />';
|
||||
if ($objcon && get_class($objcon) == 'Contact' && get_class($filterobj) == 'Societe')
|
||||
{
|
||||
$out.='<input type="hidden" name="id" value="'.$objcon->id.'" />';
|
||||
}
|
||||
else
|
||||
{
|
||||
$out.='<input type="hidden" name="id" value="'.$filterobj->id.'" />';
|
||||
}
|
||||
if (get_class($filterobj) == 'Societe') $out.='<input type="hidden" name="socid" value="'.$filterobj->id.'" />';
|
||||
|
||||
$out.="\n";
|
||||
@ -1179,18 +1186,18 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
|
||||
$out.='<tr class="liste_titre">';
|
||||
if ($donetodo)
|
||||
{
|
||||
$out.='<td></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
}
|
||||
$out.='<td></td>';
|
||||
$out.='<td class="maxwidth100onsmartphone"><input type="text" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre maxwidth100onsmartphone"><input type="text" name="search_agenda_label" value="'.$filters['search_agenda_label'].'"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre">';
|
||||
$out.=$formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:-1, 0, 0, 1);
|
||||
$out.='</td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
$out.='<td class="liste_titre"></td>';
|
||||
// Action column
|
||||
$out.='<td class="liste_titre" align="middle">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
|
||||
@ -84,11 +84,23 @@ function contact_prepare_head(Contact $object)
|
||||
$head[$tab][2] = 'documents';
|
||||
$tab++;
|
||||
|
||||
// Info
|
||||
// Agenda / Events
|
||||
$head[$tab][0] = DOL_URL_ROOT.'/contact/agenda.php?id='.$object->id;
|
||||
$head[$tab][1].= $langs->trans("Events");
|
||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||
{
|
||||
$head[$tab][1].= '/';
|
||||
$head[$tab][1].= $langs->trans("Agenda");
|
||||
}
|
||||
$head[$tab][2] = 'agenda';
|
||||
$tab++;
|
||||
|
||||
// Log
|
||||
/*
|
||||
$head[$tab][0] = DOL_URL_ROOT.'/contact/info.php?id='.$object->id;
|
||||
$head[$tab][1] = $langs->trans("Info");
|
||||
$head[$tab][2] = 'info';
|
||||
$tab++;
|
||||
$tab++;*/
|
||||
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$tab,'contact','remove');
|
||||
|
||||
|
||||
@ -3636,7 +3636,7 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=
|
||||
* @param float $vatrate Vat rate. Can be '8.5' or '8.5 (VATCODEX)' for example
|
||||
* @param int $local Local tax to search and return (1 or 2 return only tax rate 1 or tax rate 2)
|
||||
* @param Societe $thirdparty_buyer Object of buying third party
|
||||
* @param Societe $thirdparty_seller Object of selling third party
|
||||
* @param Societe $thirdparty_seller Object of selling third party ($mysoc if not defined)
|
||||
* @param int $vatnpr If vat rate is NPR or not
|
||||
* @return mixed 0 if not found, localtax rate if found
|
||||
* @see get_default_tva
|
||||
@ -3695,18 +3695,15 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
||||
if ($local == 1 && ! $thirdparty_seller->localtax1_assuj) return 0;
|
||||
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
|
||||
}
|
||||
//if ($local == 0 && ! $thirdparty_seller->localtax1_assuj && ! $thirdparty_seller->localtax2_assuj) return array('localtax1'=>0,'localtax2'=>0);
|
||||
|
||||
// Do not enabled this. We want localtax that match the vat rate.
|
||||
// If we forced a vat, we must also force local tax
|
||||
/*
|
||||
if (is_object($thirdparty_buyer))
|
||||
// For some country MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY is forced to on.
|
||||
if (in_array($mysoc->country_code, array('ES')))
|
||||
{
|
||||
if ($thirdparty_seller->country_code != $thirdparty_buyer->country_code) return 0;
|
||||
}*/
|
||||
|
||||
$conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY = 1;
|
||||
}
|
||||
|
||||
// Search local taxes
|
||||
if ($mysoc->country_code == 'ES' || ! empty($conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY))
|
||||
if (! empty($conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY))
|
||||
{
|
||||
if ($local==1)
|
||||
{
|
||||
|
||||
@ -30,26 +30,26 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
||||
*/
|
||||
class ModeleImports
|
||||
{
|
||||
var $db;
|
||||
var $datatoimport;
|
||||
public $db;
|
||||
public $datatoimport;
|
||||
|
||||
var $error='';
|
||||
public $error='';
|
||||
|
||||
var $id; // Id of driver
|
||||
var $label; // Label of driver
|
||||
var $extension; // Extension of files imported by driver
|
||||
var $version; // Version of driver
|
||||
public $id; // Id of driver
|
||||
public $label; // Label of driver
|
||||
public $extension; // Extension of files imported by driver
|
||||
public $version; // Version of driver
|
||||
|
||||
var $label_lib; // Label of external lib used by driver
|
||||
var $version_lib; // Version of external lib used by driver
|
||||
public $label_lib; // Label of external lib used by driver
|
||||
public $version_lib; // Version of external lib used by driver
|
||||
|
||||
// Array of all drivers
|
||||
var $_driverlabel=array();
|
||||
var $_driverdesc=array();
|
||||
var $_driverversion=array();
|
||||
public $_driverlabel=array();
|
||||
public $_driverdesc=array();
|
||||
public $_driverversion=array();
|
||||
|
||||
var $_liblabel=array();
|
||||
var $_libversion=array();
|
||||
public $_liblabel=array();
|
||||
public $_libversion=array();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -82,7 +82,7 @@ class modAgenda extends DolibarrModules
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($sqlreadactions))
|
||||
{
|
||||
if (preg_match('/_CREATE$/',$obj->code) && ($obj->code != 'COMPANY_CREATE')) continue; // We don't track such events (*_CREATE) by default, we prefer validation (except thirdparty creation because there is no validation).
|
||||
if (preg_match('/_CREATE$/',$obj->code) && (! in_array($obj->code, array('COMPANY_CREATE','PRODUCT_CREATE')))) continue; // We don't track such events (*_CREATE) by default, we prefer validation (except thirdparty or product creation because there is no validation).
|
||||
if (preg_match('/^PROJECT_/',$obj->code)) continue; // We don't track such events by default.
|
||||
if (preg_match('/^TASK_/',$obj->code)) continue; // We don't track such events by default.
|
||||
$this->const[] = array('MAIN_AGENDA_ACTIONAUTO_'.$obj->code, "chaine", "1");
|
||||
|
||||
@ -86,6 +86,20 @@ class modExpenseReport extends DolibarrModules
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "MAIN_DELAY_EXPENSEREPORTS";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "15";
|
||||
$this->const[$r][3] = 'Tolerance delay (in days) before alert for expense reports to approve';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "MAIN_DELAY_EXPENSEREPORTS_TO_PAY";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "15";
|
||||
$this->const[$r][3] = 'Tolerance delay (in days) before alert for expense reports to pay';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
// Array to add new pages in new tabs
|
||||
$this->tabs = array();
|
||||
|
||||
|
||||
@ -219,17 +219,16 @@ class modProjet extends DolibarrModules
|
||||
|
||||
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
|
||||
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
|
||||
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.description'=>"Text",
|
||||
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.title'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','cls.code'=>"Text",'p.opp_percent'=>'Numeric','p.description'=>"Text",
|
||||
'pt.rowid'=>'Text','pt.label'=>'Text','pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Numeric",'pt.progress'=>"Numeric",'pt.description'=>"Text",
|
||||
'ptt.rowid'=>'Numeric','ptt.task_date'=>'Date','ptt.task_duration'=>"Duree",'ptt.fk_user'=>"List:user:CONCAT(lastname,' ',firstname)",'ptt.note'=>"Text");
|
||||
|
||||
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company',
|
||||
's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company',
|
||||
'p.rowid'=>"project",'p.ref'=>"project",'p.datec'=>"project",'p.dateo'=>"project",'p.datee'=>"project",'p.duree'=>"project",'p.fk_statut'=>"project",'cls.code'=>"project",'p.opp_percent'=>'project','p.description'=>"project");
|
||||
's.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company');
|
||||
|
||||
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country',
|
||||
's.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode',
|
||||
'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'ProjectStatus','cls.code'=>'OpportunityStatus','p.opp_percent'=>'OpportunityProbability','p.description'=>"Description");
|
||||
'p.rowid'=>"ProjectId",'p.ref'=>"RefProject",'p.title'=>'ProjectLabel', 'p.datec'=>"DateCreation",'p.dateo'=>"DateStart",'p.datee'=>"DateEnd",'p.fk_statut'=>'ProjectStatus','cls.code'=>'OpportunityStatus','p.opp_percent'=>'OpportunityProbability','p.description'=>"Description");
|
||||
|
||||
// Add fields for project
|
||||
$this->export_fields_array[$r]=array_merge($this->export_fields_array[$r], array());
|
||||
|
||||
@ -300,7 +300,7 @@ print $langs->trans("NewHeight").': <input class="flat" name="sizey" size="10" t
|
||||
print '<input type="hidden" name="file" value="'.dol_escape_htmltag(GETPOST('file')).'" />';
|
||||
print '<input type="hidden" name="action" value="confirm_resize" />';
|
||||
print '<input type="hidden" name="product" value="'.$id.'" />';
|
||||
print '<input type="hidden" name="modulepart" value="'.$modulepart.'" />';
|
||||
print '<input type="hidden" name="modulepart" value="'.dol_escape_htmltag($modulepart).'" />';
|
||||
print '<input type="hidden" name="id" value="'.$id.'" />';
|
||||
print '<br>';
|
||||
print '<input class="button" id="submitresize" name="sendit" value="'.dol_escape_htmltag($langs->trans("Resize")).'" type="submit" />';
|
||||
|
||||
@ -59,12 +59,12 @@ $userstatic=new User($db);
|
||||
if ($permission) {
|
||||
?>
|
||||
<form class="tagtr liste_titre">
|
||||
<div class="tagtd"><?php echo $langs->trans("Nature"); ?></div>
|
||||
<div class="tagtd"><?php echo $langs->trans("ThirdParty"); ?></div>
|
||||
<div class="tagtd"><?php echo $langs->trans("Users").'/'.$langs->trans("Contacts"); ?></div>
|
||||
<div class="tagtd"><?php echo $langs->trans("ContactType"); ?></div>
|
||||
<div class="tagtd"> </div>
|
||||
<div class="tagtd"> </div>
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("Nature"); ?></div>
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("ThirdParty"); ?></div>
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("Users").'/'.$langs->trans("Contacts"); ?></div>
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("ContactType"); ?></div>
|
||||
<div class="tagtd liste_titre"> </div>
|
||||
<div class="tagtd liste_titre"> </div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
@ -140,12 +140,12 @@ if ($permission) {
|
||||
?>
|
||||
|
||||
<form class="tagtr liste_titre liste_titre_add formnoborder">
|
||||
<div class="tagtd"><?php echo $langs->trans("Nature"); ?></div>
|
||||
<div class="tagtd"><?php echo $langs->trans("ThirdParty"); ?></div>
|
||||
<div class="tagtd"><?php echo $langs->trans("Users").'/'.$langs->trans("Contacts"); ?></div>
|
||||
<div class="tagtd"><?php echo $langs->trans("ContactType"); ?></div>
|
||||
<div class="tagtd" align="center"><?php echo $langs->trans("Status"); ?></div>
|
||||
<div class="tagtd"> </div>
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("Nature"); ?></div>
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("ThirdParty"); ?></div>
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("Users").'/'.$langs->trans("Contacts"); ?></div>
|
||||
<div class="tagtd liste_titre"><?php echo $langs->trans("ContactType"); ?></div>
|
||||
<div class="tagtd liste_titre" align="center"><?php echo $langs->trans("Status"); ?></div>
|
||||
<div class="tagtd liste_titre"> </div>
|
||||
</form>
|
||||
|
||||
<?php $var=true; ?>
|
||||
|
||||
@ -88,9 +88,13 @@ if ($nolinesbefore) {
|
||||
}
|
||||
if (! empty($usemargins))
|
||||
{
|
||||
if (!empty($user->rights->margins->creer)) {
|
||||
?>
|
||||
<td align="right" class="margininfos linecolmargin1">
|
||||
<?php
|
||||
}
|
||||
else $colspan++;
|
||||
|
||||
if ($conf->global->MARGIN_TYPE == "1")
|
||||
echo $langs->trans('BuyingPrice');
|
||||
else
|
||||
@ -289,6 +293,7 @@ else {
|
||||
}
|
||||
if (! empty($usemargins))
|
||||
{
|
||||
if (!empty($user->rights->margins->creer)) {
|
||||
?>
|
||||
<td align="right" class="nobottom margininfos linecolmargin">
|
||||
<!-- For predef product -->
|
||||
@ -299,8 +304,9 @@ else {
|
||||
<input type="text" size="5" id="buying_price" name="buying_price" class="flat" value="<?php echo (isset($_POST["buying_price"])?GETPOST("buying_price",'alpha',2):''); ?>">
|
||||
</td>
|
||||
<?php
|
||||
|
||||
$coldisplay++;
|
||||
}
|
||||
|
||||
if ($user->rights->margins->creer)
|
||||
{
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||
@ -398,7 +404,7 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da
|
||||
|
||||
if (! empty($usemargins))
|
||||
{
|
||||
$colspan++; // For the buying price
|
||||
if (!empty($user->rights->margins->creer)) $colspan++; // For the buying price
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++;
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++;
|
||||
}
|
||||
|
||||
@ -45,6 +45,7 @@ if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0;
|
||||
$colspan = 3; // Col total ht + col edit + col delete
|
||||
if (! empty($inputalsopricewithtax)) $colspan++; // We add 1 if col total ttc
|
||||
if (in_array($object->element,array('propal','supplier_proposal','facture','invoice','commande','order','order_supplier','invoice_supplier'))) $colspan++; // With this, there is a column move button
|
||||
if (empty($user->rights->margins->creer)) $colspan++;
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE objectline_edit.tpl.php -->
|
||||
@ -174,6 +175,7 @@ $coldisplay=-1; // We remove first td
|
||||
if (! empty($usemargins))
|
||||
{
|
||||
?>
|
||||
<?php if (!empty($user->rights->margins->creer)) { ?>
|
||||
<td align="right" class="margininfos"><?php $coldisplay++; ?>
|
||||
<!-- For predef product -->
|
||||
<?php if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { ?>
|
||||
@ -182,6 +184,7 @@ $coldisplay=-1; // We remove first td
|
||||
<!-- For free product -->
|
||||
<input type="text" size="5" id="buying_price" name="buying_price" class="hideobject" value="<?php echo price($line->pa_ht,0,'',0); ?>">
|
||||
</td>
|
||||
<?php } ?>
|
||||
<?php if ($user->rights->margins->creer) {
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||
{
|
||||
|
||||
@ -186,7 +186,10 @@ if (empty($usemargins)) $usemargins=0;
|
||||
{
|
||||
$rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT);
|
||||
?>
|
||||
|
||||
<?php if (!empty($user->rights->margins->creer)) { ?>
|
||||
<td align="right" class="linecolmargin1 nowrap margininfos"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
|
||||
<?php } ?>
|
||||
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) { ?>
|
||||
<td align="right" class="linecolmargin2 nowrap margininfos"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?></td>
|
||||
<?php }
|
||||
|
||||
@ -24,33 +24,34 @@
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
|
||||
|
||||
/** \class PaymentDonation
|
||||
* \brief Class to manage payments of donations
|
||||
/**
|
||||
* Class to manage payments of donations
|
||||
*/
|
||||
class PaymentDonation extends CommonObject
|
||||
{
|
||||
public $element='payment_donation'; //!< Id that identify managed objects
|
||||
public $table_element='payment_donation'; //!< Name of table without prefix where object is stored
|
||||
public $picto = 'payment';
|
||||
|
||||
public $rowid;
|
||||
|
||||
var $rowid;
|
||||
|
||||
var $fk_donation;
|
||||
var $datec='';
|
||||
var $tms='';
|
||||
var $datep='';
|
||||
var $amount; // Total amount of payment
|
||||
var $amounts=array(); // Array of amounts
|
||||
var $typepayment;
|
||||
var $num_payment;
|
||||
var $fk_bank;
|
||||
var $fk_user_creat;
|
||||
var $fk_user_modif;
|
||||
public $fk_donation;
|
||||
public $datec='';
|
||||
public $tms='';
|
||||
public $datep='';
|
||||
public $amount; // Total amount of payment
|
||||
public $amounts=array(); // Array of amounts
|
||||
public $typepayment;
|
||||
public $num_payment;
|
||||
public $fk_bank;
|
||||
public $fk_user_creat;
|
||||
public $fk_user_modif;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @see amount, amounts
|
||||
*/
|
||||
var $total;
|
||||
public $total;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -432,6 +433,32 @@ class PaymentDonation extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retourne le libelle du statut d'un don (brouillon, validee, abandonnee, payee)
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long
|
||||
* @return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoi le libelle d'un statut donne
|
||||
*
|
||||
* @param int $statut Id statut
|
||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Libelle du statut
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialise an instance with random values.
|
||||
* Used to build previews or test instances.
|
||||
|
||||
@ -40,10 +40,10 @@ if ($user->societe_id) $socid=$user->societe_id;
|
||||
// TODO Add rule to restrict access payment
|
||||
//$result = restrictedArea($user, 'facture', $id,'');
|
||||
|
||||
$payment = new PaymentDonation($db);
|
||||
$object = new PaymentDonation($db);
|
||||
if ($id > 0)
|
||||
{
|
||||
$result=$payment->fetch($id);
|
||||
$result=$object->fetch($id);
|
||||
if (! $result) dol_print_error($db,'Failed to get payment id '.$id);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->don->supp
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$result = $payment->delete($user);
|
||||
$result = $object->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
@ -66,7 +66,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->don->supp
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($payment->error, $payment->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -76,7 +76,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->don->cree
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$result=$payment->valide();
|
||||
$result=$object->valide();
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
@ -99,12 +99,12 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->don->cree
|
||||
}
|
||||
}
|
||||
|
||||
header('Location: card.php?id='.$payment->id);
|
||||
header('Location: card.php?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($payment->error, $payment->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -133,7 +133,7 @@ dol_fiche_head($head, $hselected, $langs->trans("DonationPayment"), 0, 'payment'
|
||||
*/
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
|
||||
print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
|
||||
|
||||
}
|
||||
|
||||
@ -142,46 +142,51 @@ if ($action == 'delete')
|
||||
*/
|
||||
if ($action == 'valide')
|
||||
{
|
||||
$facid = $_GET['facid'];
|
||||
print $form->formconfirm('card.php?id='.$payment->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
|
||||
$facid = GETPOST('facid','int');
|
||||
print $form->formconfirm('card.php?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
dol_banner_tab($object,'id','',1,'rowid','id');
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td valign="top" width="20%">'.$langs->trans('Ref').'</td>';
|
||||
/*print '<tr><td class=">'.$langs->trans('Ref').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print $form->showrefnav($payment,'id','',1,'rowid','id');
|
||||
print $form->showrefnav($object,'id','',1,'rowid','id');
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
// Date
|
||||
print '<tr><td valign="top">'.$langs->trans('Date').'</td><td colspan="3">'.dol_print_date($payment->datep,'day').'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans('Date').'</td><td>'.dol_print_date($object->datep,'day').'</td></tr>';
|
||||
|
||||
// Mode
|
||||
print '<tr><td valign="top">'.$langs->trans('Mode').'</td><td colspan="3">'.$langs->trans("PaymentType".$payment->type_code).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Mode').'</td><td>'.$langs->trans("PaymentType".$object->type_code).'</td></tr>';
|
||||
|
||||
// Number
|
||||
print '<tr><td valign="top">'.$langs->trans('Number').'</td><td colspan="3">'.$payment->num_payment.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Number').'</td><td>'.$object->num_payment.'</td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td valign="top">'.$langs->trans('Amount').'</td><td colspan="3">'.price($payment->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Amount').'</td><td>'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
|
||||
// Note
|
||||
print '<tr><td valign="top">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($payment->note).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Note').'</td><td>'.nl2br($object->note).'</td></tr>';
|
||||
|
||||
// Bank account
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
if ($payment->bank_account)
|
||||
if ($object->bank_account)
|
||||
{
|
||||
$bankline=new AccountLine($db);
|
||||
$bankline->fetch($payment->bank_line);
|
||||
$bankline->fetch($object->bank_line);
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('BankTransactionLine').'</td>';
|
||||
print '<td colspan="3">';
|
||||
print '<td>';
|
||||
print $bankline->getNomUrl(1,0,'showall');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -269,7 +274,7 @@ print '<div class="tabsAction">';
|
||||
/*
|
||||
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
|
||||
{
|
||||
if ($user->societe_id == 0 && $payment->statut == 0 && $_GET['action'] == '')
|
||||
if ($user->societe_id == 0 && $object->statut == 0 && $_GET['action'] == '')
|
||||
{
|
||||
if ($user->rights->facture->paiement)
|
||||
{
|
||||
|
||||
@ -1617,17 +1617,17 @@ else
|
||||
// Validation date
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("DATE_SAVE").'</td>';
|
||||
print '<td>'.dol_print_date($object->date_create,'dayhour');
|
||||
print '<td>'.dol_print_date($object->date_valid,'dayhour');
|
||||
if ($object->status == 2 && $object->hasDelay('toapprove')) print ' '.img_warning($langs->trans("Late"));
|
||||
if ($object->status == 5 && $object->hasDelay('topay')) print ' '.img_warning($langs->trans("Late"));
|
||||
print '</td></tr>';
|
||||
print '</tr>';
|
||||
|
||||
// User to inform
|
||||
// User to inform for approval
|
||||
if ($object->fk_statut < 3) // informed
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("VALIDATOR").'</td>';
|
||||
print '<td>'.$langs->trans("VALIDATOR").'</td>'; // approver
|
||||
print '<td>';
|
||||
if ($object->fk_user_validator > 0)
|
||||
{
|
||||
|
||||
@ -984,7 +984,6 @@ class ExpenseReport extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->fk_statut != 2)
|
||||
{
|
||||
$now = dol_now();
|
||||
@ -995,7 +994,7 @@ class ExpenseReport extends CommonObject
|
||||
$sql.= ", ref_number_int = ".$ref_number_int;
|
||||
}
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -1706,13 +1705,13 @@ class ExpenseReport extends CommonObject
|
||||
|
||||
if ($option == 'toapprove')
|
||||
{
|
||||
if ($this->db->jdate($obj->datevalid) < ($now - $conf->expensereport->approve->warning_delay)) {
|
||||
if ($this->db->jdate($obj->date_valid) < ($now - $conf->expensereport->approve->warning_delay)) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->db->jdate($obj->datevalid) < ($now - $conf->expensereport->payment->warning_delay)) {
|
||||
if ($this->db->jdate($obj->date_valid) < ($now - $conf->expensereport->payment->warning_delay)) {
|
||||
$response->nbtodolate++;
|
||||
}
|
||||
}
|
||||
@ -1743,11 +1742,12 @@ class ExpenseReport extends CommonObject
|
||||
if ($option == 'topay' && $this->status != 5) return false;
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
if ($option == 'toapprove')
|
||||
return $this->datevalid < ($now - $conf->expensereport->approve->warning_delay);
|
||||
{
|
||||
return ($this->datevalid?$this->datevalid:$this->date_valid) < ($now - $conf->expensereport->approve->warning_delay);
|
||||
}
|
||||
else
|
||||
return $this->datevalid < ($now - $conf->expensereport->payment->warning_delay);
|
||||
return ($this->datevalid?$this->datevalid:$this->date_valid) < ($now - $conf->expensereport->payment->warning_delay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -49,16 +49,19 @@ $result = restrictedArea($user, 'expensereport','','');
|
||||
|
||||
$diroutputmassaction=$conf->expensereport->dir_output . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='c.ref';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
if (!$sortorder) $sortorder="DESC";
|
||||
if (!$sortfield) $sortfield="d.date_debut";
|
||||
|
||||
|
||||
$sall = GETPOST('sall');
|
||||
$search_ref = GETPOST('search_ref');
|
||||
@ -103,6 +106,8 @@ $arrayfields=array(
|
||||
'user'=>array('label'=>$langs->trans("User"), 'checked'=>1),
|
||||
'd.date_debut'=>array('label'=>$langs->trans("DateStart"), 'checked'=>1),
|
||||
'd.date_fin'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1),
|
||||
'd.date_valid'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
|
||||
'd.date_approve'=>array('label'=>$langs->trans("DateApprove"), 'checked'=>1),
|
||||
'd.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
|
||||
'd.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>1),
|
||||
'd.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>1),
|
||||
@ -176,23 +181,9 @@ llxHeader('', $langs->trans("ListOfTrips"));
|
||||
$max_year = 5;
|
||||
$min_year = 5;
|
||||
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$page = GETPOST("page");
|
||||
if (!$sortorder) $sortorder="DESC";
|
||||
if (!$sortfield) $sortfield="d.date_debut";
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
|
||||
if ($page == -1) {
|
||||
$page = 0 ;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$sql = "SELECT d.rowid, d.ref, d.fk_user_author, d.total_ht, d.total_tva, d.total_ttc, d.fk_statut as status,";
|
||||
$sql.= " d.date_debut, d.date_fin, d.date_valid, d.date_create, d.tms as date_modif,";
|
||||
$sql.= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve,";
|
||||
$sql.= " u.rowid as id_user, u.firstname, u.lastname, u.login, u.statut, u.photo";
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
@ -355,13 +346,15 @@ if ($resql)
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.ref","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['user']['checked'])) print_liste_field_titre($langs->trans("User"),$_SERVER["PHP_SELF"],"u.lastname","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.date_debut']['checked'])) print_liste_field_titre($langs->trans("DateStart"),$_SERVER["PHP_SELF"],"d.date_debut","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.date_fin']['checked'])) print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"d.date_fin","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.total_ht']['checked'])) print_liste_field_titre($langs->trans("TotalHT"),$_SERVER["PHP_SELF"],"d.total_ht","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.total_vat']['checked'])) print_liste_field_titre($langs->trans("TotalVAT"),$_SERVER["PHP_SELF"],"d.total_tva","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.total_ttc']['checked'])) print_liste_field_titre($langs->trans("TotalTTC"),$_SERVER["PHP_SELF"],"d.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],"d.ref","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['user']['checked'])) print_liste_field_titre($arrayfields['user']['label'],$_SERVER["PHP_SELF"],"u.lastname","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.date_debut']['checked'])) print_liste_field_titre($arrayfields['d.date_debut']['label'],$_SERVER["PHP_SELF"],"d.date_debut","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.date_fin']['checked'])) print_liste_field_titre($arrayfields['d.date_fin']['label'],$_SERVER["PHP_SELF"],"d.date_fin","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.date_valid']['checked'])) print_liste_field_titre($arrayfields['d.date_valid']['label'],$_SERVER["PHP_SELF"],"d.date_valid","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.date_approve']['checked'])) print_liste_field_titre($arrayfields['d.date_approve']['label'],$_SERVER["PHP_SELF"],"d.date_approve","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.total_ht']['checked'])) print_liste_field_titre($arrayfields['d.total_ht']['label'],$_SERVER["PHP_SELF"],"d.total_ht","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.total_vat']['checked'])) print_liste_field_titre($arrayfields['d.total_vat']['label'],$_SERVER["PHP_SELF"],"d.total_tva","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['d.total_ttc']['checked'])) print_liste_field_titre($arrayfields['d.total_ttc']['label'],$_SERVER["PHP_SELF"],"d.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
@ -420,7 +413,23 @@ if ($resql)
|
||||
$formother->select_year($year_end,'year_end',1, $min_year, $max_year);
|
||||
print '</td>';
|
||||
}
|
||||
// Amount with no tax
|
||||
// Date valid
|
||||
if (! empty($arrayfields['d.date_valid']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="center">';
|
||||
//print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.$month_end.'">';
|
||||
//$formother->select_year($year_end,'year_end',1, $min_year, $max_year);
|
||||
print '</td>';
|
||||
}
|
||||
// Date approve
|
||||
if (! empty($arrayfields['d.date_approve']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="center">';
|
||||
//print '<input class="flat" type="text" size="1" maxlength="2" name="month_end" value="'.$month_end.'">';
|
||||
//$formother->select_year($year_end,'year_end',1, $min_year, $max_year);
|
||||
print '</td>';
|
||||
}
|
||||
// Amount with no tax
|
||||
if (! empty($arrayfields['d.total_ht']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="5" name="search_amount_ht" value="'.$search_amount_ht.'"></td>';
|
||||
@ -509,12 +518,13 @@ if ($resql)
|
||||
$expensereportstatic->id=$obj->rowid;
|
||||
$expensereportstatic->ref=$obj->ref;
|
||||
$expensereportstatic->status=$obj->status;
|
||||
$expensereportstatic->valid=$obj->date_valid;
|
||||
$expensereportstatic->date_debut=$obj->date_debut;
|
||||
$expensereportstatic->date_fin=$obj->date_fin;
|
||||
$expensereportstatic->date_create=$obj->date_create;
|
||||
$expensereportstatic->date_modif=$obj->date_modif;
|
||||
|
||||
$expensereportstatic->date_debut=$db->jdate($obj->date_debut);
|
||||
$expensereportstatic->date_fin=$db->jdate($obj->date_fin);
|
||||
$expensereportstatic->date_create=$db->jdate($obj->date_create);
|
||||
$expensereportstatic->date_modif=$db->jdate($obj->date_modif);
|
||||
$expensereportstatic->date_valid=$db->jdate($obj->date_valid);
|
||||
$expensereportstatic->date_approve=$db->jdate($obj->date_approve);
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var].">";
|
||||
if (! empty($arrayfields['d.ref']['checked'])) {
|
||||
@ -545,7 +555,15 @@ if ($resql)
|
||||
print '<td align="center">'.($obj->date_fin > 0 ? dol_print_date($obj->date_fin, 'day') : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Amount HT
|
||||
if (! empty($arrayfields['d.date_valid']['checked'])) {
|
||||
print '<td align="center">'.($obj->date_valid > 0 ? dol_print_date($obj->date_valid, 'day') : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['d.date_approve']['checked'])) {
|
||||
print '<td align="center">'.($obj->date_approve > 0 ? dol_print_date($obj->date_approve, 'day') : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Amount HT
|
||||
if (! empty($arrayfields['d.total_ht']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($obj->total_ht)."</td>\n";
|
||||
|
||||
@ -196,7 +196,7 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||
|
||||
$h=0;
|
||||
$head = array();
|
||||
$head[$h][0] = DOL_URL_ROOT . '/compta/expensereport/stats/index.php';
|
||||
$head[$h][0] = DOL_URL_ROOT . '/expensereport/stats/index.php';
|
||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||
$head[$h][2] = 'byyear';
|
||||
$h++;
|
||||
|
||||
@ -175,25 +175,41 @@ else
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'" id="tablelines3">'."\n";
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<td width="55%">'.$langs->trans('Employee').'</td>';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans('Employee'), $_SERVER["PHP_SELF"]);
|
||||
if (count($typeleaves))
|
||||
{
|
||||
foreach($typeleaves as $key => $val)
|
||||
{
|
||||
print '<td width="20%" style="text-align:center">'.$val['label'].'</td>';
|
||||
print '<th style="text-align:center">'.$val['label'].'</th>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>'.$langs->trans("NoLeaveWithCounterDefined").'</td>';
|
||||
print '<th>'.$langs->trans("NoLeaveWithCounterDefined").'</th>';
|
||||
}
|
||||
print '<td width="20%" style="text-align:center">';
|
||||
print '<th style="text-align:center">';
|
||||
if ($canedit) print $langs->trans('Note');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '</th>';
|
||||
print_liste_field_titre('');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
if (count($typeleaves))
|
||||
{
|
||||
foreach($typeleaves as $key => $val)
|
||||
{
|
||||
print '<td class="liste_titre" style="text-align:center"></td>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td class="liste_titre"></td>';
|
||||
}
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '</tr>';
|
||||
|
||||
foreach($listUsers as $users)
|
||||
{
|
||||
$var=!$var;
|
||||
@ -204,7 +220,7 @@ else
|
||||
if (($users['rowid'] != $user->id) && (! in_array($users['rowid'], $userchilds))) continue; // This user is not into hierarchy of current user, we hide it.
|
||||
}
|
||||
|
||||
print '<tr '.$bc[$var].' style="height: 20px;">';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>';
|
||||
$userstatic->id=$users['rowid'];
|
||||
$userstatic->lastname=$users['lastname'];
|
||||
|
||||
@ -78,17 +78,28 @@ print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"")
|
||||
|
||||
print '<tbody>';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre">'.$langs->trans('ID').'</td>';
|
||||
print '<td class="liste_titre" align="center">'.$langs->trans('Date').'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans('ActionByCP').'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans('UserUpdateCP').'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans('Description').'</td>';
|
||||
print '<td class="liste_titre">'.$langs->trans('Type').'</td>';
|
||||
print '<td class="liste_titre" align="right">'.$langs->trans('PrevSoldeCP').'</td>';
|
||||
print '<td class="liste_titre" align="right">'.$langs->trans('NewSoldeCP').'</td>';
|
||||
|
||||
print_liste_field_titre($langs->trans('ID'));
|
||||
print_liste_field_titre($langs->trans('Date'), $_SERVER["PHP_SELF"], '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans('ActionByCP'));
|
||||
print_liste_field_titre($langs->trans('UserUpdateCP'));
|
||||
print_liste_field_titre($langs->trans('Description'));
|
||||
print_liste_field_titre($langs->trans('Type'));
|
||||
print_liste_field_titre($langs->trans('PrevSoldeCP'), $_SERVER["PHP_SELF"], '', '', '', 'align="right"');
|
||||
print_liste_field_titre($langs->trans('NewSoldeCP'), $_SERVER["PHP_SELF"], '', '', '', 'align="right"');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$var=true;
|
||||
|
||||
foreach($cp->logs as $logs_CP)
|
||||
|
||||
@ -384,11 +384,11 @@ function pHeader($subtitle,$next,$action='set',$param='',$forcejqueryurl='')
|
||||
// We force the content charset
|
||||
header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||
|
||||
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n";
|
||||
print '<!DOCTYPE HTML>'."\n";
|
||||
print '<html>'."\n";
|
||||
print '<head>'."\n";
|
||||
print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
|
||||
print '<meta http-equiv="content-type" content="text/html; charset='.$conf->file->character_set_client.'">'."\n";
|
||||
print '<meta charset='.$conf->file->character_set_client.'">'."\n";
|
||||
print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'."\n";
|
||||
print '<link rel="stylesheet" type="text/css" href="default.css">'."\n";
|
||||
|
||||
print '<!-- Includes CSS for JQuery -->'."\n";
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
-- List of all managed triggered events (used for trigger agenda automatic events and for notification)
|
||||
--
|
||||
delete from llx_c_action_trigger;
|
||||
-- actions enabled by default (constant created for that) when we enable module agenda
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_CREATE','Third party created','Executed when a third party is created','societe',1);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('COMPANY_SENTBYMAIL','Mails sent from third party card','Executed when you send email from third party card','societe',1);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROPAL_VALIDATE','Customer proposal validated','Executed when a commercial proposal is validated','propal',2);
|
||||
@ -79,6 +80,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30);
|
||||
-- actions not enabled by default (no constant created for that) when we enable module agenda
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_CREATE','Project creation','Executed when a project is created','project',140);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_MODIFY','Project modified','Executed when a project is modified','project',141);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_DELETE','Project deleted','Executed when a project is deleted','project',142);
|
||||
|
||||
@ -178,6 +178,7 @@ ErrorFailedToLoadLoginFileForMode=Failed to get the login file for mode '%s'.
|
||||
ErrorModuleNotFound=File of module was not found.
|
||||
ErrorFieldAccountNotDefinedForBankLine=Value for Accounting account not defined for source bank line %s
|
||||
ErrorBankStatementNameMustFollowRegex=Error, bank statement name must follow the following syntax rule %s
|
||||
ErrorPhpMailDelivery=Check that you don't use a too high number of recipients and that your email content is not similar to a Spam. Ask also your administrator to check firewall and server logs files for a more complete information.
|
||||
|
||||
# Warnings
|
||||
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
|
||||
|
||||
@ -89,7 +89,7 @@ SearchAMailing=Search mailing
|
||||
SendMailing=Send emailing
|
||||
SendMail=Send email
|
||||
SentBy=Sent by
|
||||
MailingNeedCommand=For security reason, sending an emailing must be performed from command line. Ask your server administrator to launch the following command to send the emailing to all recipients:
|
||||
MailingNeedCommand=Sending an emailing can be performed from command line. Ask your server administrator to launch the following command to send the emailing to all recipients:
|
||||
MailingNeedCommand2=You can however send them online by adding parameter MAILING_LIMIT_SENDBYWEB with value of max number of emails you want to send by session. For this, go on Home - Setup - Other.
|
||||
ConfirmSendingEmailing=If you want to send emailing directly from this screen, please confirm you are sure you want to send emailing now from your browser ?
|
||||
LimitSendingEmailing=Note: Sending of emailings from web interface is done in several times for security and timeout reasons, <b>%s</b> recipients at a time for each sending session.
|
||||
|
||||
@ -1003,10 +1003,10 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
||||
|
||||
if (empty($conf->css)) $conf->css = '/theme/eldy/style.css.php'; // If not defined, eldy by default
|
||||
|
||||
if (empty($conf->global->MAIN_ACTIVATE_HTML5)) {
|
||||
if (! empty($conf->global->MAIN_ACTIVATE_HTML4)) {
|
||||
$doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
|
||||
}else {
|
||||
$doctype = '<!doctype html>'; // Html5 - Developement - Only available on Eldy template
|
||||
$doctype = '<!doctype html>';
|
||||
}
|
||||
print $doctype."\n";
|
||||
if (! empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print '<html lang="'.substr($langs->defaultlang,0,2).'" manifest="'.DOL_URL_ROOT.'/cache.manifest">'."\n";
|
||||
|
||||
@ -286,10 +286,17 @@ if (empty($reshook))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$npr = $obj->recuperableonly;
|
||||
$localtax1 = get_localtax($tva_tx,1);
|
||||
$localtax2 = get_localtax($tva_tx,2);
|
||||
$localtax1 = $obj->localtax1;
|
||||
$localtax2 = $obj->localtax2;
|
||||
$localtax1_type = $obj->localtax1_type;
|
||||
$localtax2_type = $obj->localtax2_type;
|
||||
|
||||
// If spain, we don't use the localtax found into tax record in database with same code, but using the get_localtax rule
|
||||
if (in_array($mysoc->country_code, array('ES')))
|
||||
{
|
||||
$localtax1 = get_localtax($tva_tx,1);
|
||||
$localtax2 = get_localtax($tva_tx,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
$pricestoupdate[0] = array(
|
||||
|
||||
@ -640,9 +640,14 @@ foreach ($listofreferent as $key => $value)
|
||||
$addform='';
|
||||
|
||||
$idtofilterthirdparty=0;
|
||||
if (! in_array($tablename, array('facture_fourn', 'commande_fournisseur'))) $idtofilterthirdparty=$object->thirdparty->id;
|
||||
$array_of_element_linkable_with_different_thirdparty = array('facture_fourn', 'commande_fournisseur');
|
||||
if (! in_array($tablename, $array_of_element_linkable_with_different_thirdparty))
|
||||
{
|
||||
$idtofilterthirdparty=$object->thirdparty->id;
|
||||
if (! empty($conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS)) $idtofilterthirdparty.=','.$conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS;
|
||||
}
|
||||
|
||||
if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty > 0)
|
||||
if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty)
|
||||
{
|
||||
$selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300');
|
||||
if (! $selectList || ($selectList<0))
|
||||
|
||||
@ -73,11 +73,21 @@ $parameters=array('id'=>$socid);
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (empty($reshook))
|
||||
{
|
||||
$actioncode='';
|
||||
$search_agenda_label='';
|
||||
// Cancel
|
||||
if (GETPOST("cancel") && ! empty($backtopage))
|
||||
{
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$actioncode='';
|
||||
$search_agenda_label='';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -90,7 +100,7 @@ $contactstatic = new Contact($db);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($socid)
|
||||
if ($socid > 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
* Copyright (C) 2012-2014 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@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
|
||||
@ -1632,24 +1633,11 @@ class SupplierProposal extends CommonObject
|
||||
$trigger_name='SUPPLIER_PROPOSAL_CLOSE_SIGNED';
|
||||
$modelpdf=$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL?$conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_TOBILL:$this->modelpdf;
|
||||
|
||||
// The connected company is classified as a client
|
||||
$soc=new Societe($this->db);
|
||||
$soc->id = $this->socid;
|
||||
$result=$soc->set_as_client();
|
||||
|
||||
if ($result < 0)
|
||||
if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
$result = $this->updateOrCreatePriceFournisseur($user);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($conf->global->SUPPLIER_PROPOSAL_UPDATE_PRICE_ON_SUPPlIER_PROPOSAL)) // TODO This option was not tested correctly. Error if product ref does not exists
|
||||
{
|
||||
$result = $this->updateOrCreatePriceFournisseur($user);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if ($statut == 4)
|
||||
{
|
||||
|
||||
@ -867,12 +867,12 @@ div.fichecenterbis {
|
||||
div.fichethirdleft {
|
||||
<?php if ($conf->browser->layout != 'phone') { print "float: ".$left.";\n"; } ?>
|
||||
<?php if ($conf->browser->layout != 'phone') { print "width: 50%;\n"; } ?>
|
||||
<?php if ($conf->browser->layout == 'phone') { print "padding-bottom: 6px;\n"; } ?>
|
||||
<?php if ($conf->browser->layout == 'phone') { print "padding-bottom: 6px;\n"; } ?>
|
||||
}
|
||||
div.fichetwothirdright {
|
||||
<?php if ($conf->browser->layout != 'phone') { print "float: ".$right.";\n"; } ?>
|
||||
<?php if ($conf->browser->layout != 'phone') { print "width: 50%;\n"; } ?>
|
||||
<?php if ($conf->browser->layout == 'phone') { print "padding-bottom: 6px\n"; } ?>
|
||||
<?php if ($conf->browser->layout == 'phone') { print "padding-bottom: 6px\n"; } ?>
|
||||
}
|
||||
div.fichehalfleft {
|
||||
<?php if ($conf->browser->layout != 'phone') { print "float: ".$left.";\n"; } ?>
|
||||
@ -4451,7 +4451,7 @@ border-top-right-radius: 6px;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
padding-top: 18px;
|
||||
padding-left: 54px;
|
||||
: 54px;
|
||||
font-size: 14px;
|
||||
height: 38px;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user