Exemplo n.º 1
0
 }
 dol_fiche_head();
 print '<table class="border" width="100%">';
 // Reference
 print '<tr><td class="fieldrequired">' . $langs->trans('Ref') . '</td><td colspan="2">' . $langs->trans("Draft") . '</td></tr>';
 // Third party
 print '<tr>';
 print '<td class="fieldrequired">' . $langs->trans('Supplier') . '</td>';
 if ($socid > 0) {
     print '<td colspan="2">';
     print $soc->getNomUrl(1);
     print '<input type="hidden" name="socid" value="' . $soc->id . '">';
     print '</td>';
 } else {
     print '<td colspan="2">';
     print $form->select_company('', 'socid', 's.fournisseur = 1', 1);
     print '</td>';
 }
 print '</tr>' . "\n";
 // Terms of payment
 print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">';
 $form->select_conditions_paiements($soc->cond_reglement_id, 'cond_reglement_id', -1, 1);
 print '</td></tr>';
 // Mode of payment
 print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
 $form->select_types_paiements($soc->mode_reglement_id, 'mode_reglement_id');
 print '</td></tr>';
 // Bank Account
 if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && $conf->banque->enabled) {
     print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
     $form->select_comptes($fk_account, 'fk_account', 0, '', 1);
Exemplo n.º 2
0
	});
});
</script>';
// Checkbox to select from free text
print '<input id="fillmanually" type="radio" ' . (!GETPOST("selectorforbarcode") || GETPOST("selectorforbarcode") == 'fillmanually' ? 'checked ' : '') . 'name="selectorforbarcode" value="fillmanually" class="radiobarcodeselect"> ' . $langs->trans("FillBarCodeTypeAndValueManually") . ' &nbsp; ';
print '<br>';
print '<input id="fillfromproduct" type="radio" ' . (GETPOST("selectorforbarcode") == 'fillfromproduct' ? 'checked ' : '') . 'name="selectorforbarcode" value="fillfromproduct" class="radiobarcodeselect"> ' . $langs->trans("FillBarCodeTypeAndValueFromProduct") . ' &nbsp; ';
print '<br>';
print '<div class="showforproductselector">';
$form->select_produits(GETPOST('productid'), 'productid', '');
print ' &nbsp; <input type="submit" id="submitproduct" name="submitproduct" class="button" value="' . dol_escape_htmltag($langs->trans("GetBarCode")) . '">';
print '</div>';
print '<input id="fillfromthirdparty" type="radio" ' . (GETPOST("selectorforbarcode") == 'fillfromthirdparty' ? 'checked ' : '') . 'name="selectorforbarcode" value="fillfromthirdparty" class="radiobarcodeselect"> ' . $langs->trans("FillBarCodeTypeAndValueFromThirdParty") . ' &nbsp; ';
print '<br>';
print '<div class="showforthirdpartyselector">';
print $form->select_company(GETPOST('socid'), 'socid', '', 1, 0, 0, array(), 0, 'minwidth300');
print ' &nbsp; <input type="submit" id="submitthirdparty" name="submitthirdparty" class="button showforthirdpartyselector" value="' . dol_escape_htmltag($langs->trans("GetBarCode")) . '">';
print '</div>';
print '<br>';
if ($producttmp->id > 0) {
    print $langs->trans("BarCodeDataForProduct", '') . ' ' . $producttmp->getNomUrl(1) . '<br>';
}
if ($thirdpartytmp->id > 0) {
    print $langs->trans("BarCodeDataForThirdparty", '') . ' ' . $thirdpartytmp->getNomUrl(1) . '<br>';
}
print '<div class="tagtable">';
// Barcode type
print '	<div class="tagtr">';
print '	<div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
print $langs->trans("BarcodeType") . ' &nbsp; ';
print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
Exemplo n.º 3
0
 // Realised by
 if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) {
     print '<tr><td class="nowrap">' . $langs->trans("ActionDoneBy") . '</td><td colspan="3">';
     print $form->select_dolusers($object->userdoneid > 0 ? $object->userdoneid : -1, 'doneby', 1);
     print '</td></tr>';
 }
 print '</table>';
 print '<br><br>';
 print '<table class="border" width="100%">';
 // Thirdparty - Contact
 if ($conf->societe->enabled) {
     print '<tr><td width="30%">' . $langs->trans("ActionOnCompany") . '</td>';
     print '<td>';
     $events = array();
     $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
     print $form->select_company($object->socid, 'socid', '', 1, 1, 0, $events);
     print '</td>';
     // Contact
     print '<td>' . $langs->trans("Contact") . '</td><td>';
     $form->select_contacts($object->socid, $object->contactid, 'contactid', 1, '', '', 0, 'minwidth200');
     print '</td></tr>';
 }
 // Project
 if (!empty($conf->projet->enabled)) {
     $formproject = new FormProjets($db);
     $langs->load("project");
     print '<tr><td width="30%">' . $langs->trans("Project") . '</td><td colspan="3">';
     $numprojet = $formproject->select_projects($object->socid, $object->fk_project, 'projectid');
     if ($numprojet == 0) {
         print ' &nbsp; <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->socid . '&action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit') . '">' . $langs->trans("AddProject") . '</a>';
     }
Exemplo n.º 4
0
 print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
 print '<input type="hidden" name="action" value="add">';
 print '<input type="hidden" name="origin" value="' . GETPOST('origin') . '">';
 print '<input type="hidden" name="originid" value="' . GETPOST('originid') . '">';
 print '<table class="border" width="100%">';
 // Ref
 print '<tr><td>' . $langs->trans('Ref') . '</td><td>' . $langs->trans('Draft') . '</td></tr>';
 // Third party
 print '<tr><td class="fieldrequired">' . $langs->trans('Supplier') . '</td>';
 print '<td>';
 if (GETPOST('socid') > 0) {
     print $societe->getNomUrl(1);
     print '<input type="hidden" name="socid" value="' . GETPOST('socid', 'int') . '">';
 } else {
     print $form->select_company(GETPOST('socid', 'int'), 'socid', 's.fournisseur = 1', 1);
 }
 print '</td></tr>';
 // Ref supplier
 print '<tr><td class="fieldrequired">' . $langs->trans('RefSupplier') . '</td><td><input name="ref_supplier" value="' . (isset($_POST['ref_supplier']) ? $_POST['ref_supplier'] : '') . '" type="text"></td>';
 print '</tr>';
 print '<tr><td valign="top" class="fieldrequired">' . $langs->trans('Type') . '</td><td colspan="2">';
 print '<table class="nobordernopadding">' . "\n";
 // Standard invoice
 print '<tr height="18"><td width="16px" valign="middle">';
 print '<input type="radio" name="type" value="0"' . ($_POST['type'] == 0 ? ' checked' : '') . '>';
 print '</td><td valign="middle">';
 $desc = $form->textwithpicto($langs->trans("InvoiceStandardAsk"), $langs->transnoentities("InvoiceStandardDesc"), 1);
 print $desc;
 print '</td></tr>' . "\n";
 /*
Exemplo n.º 5
0
 dol_fiche_head();
 print '<table class="border" width="100%">';
 print '<tr><td class="fieldrequired" width="25%">' . $langs->trans("Supplier") . '</td><td>';
 if ($rowid) {
     $supplier = new Fournisseur($db);
     $supplier->fetch($socid);
     print $supplier->getNomUrl(1);
     print '<input type="hidden" name="id_fourn" value="' . $socid . '">';
     print '<input type="hidden" name="ref_fourn" value="' . $object->fourn_ref . '">';
     print '<input type="hidden" name="ref_fourn_price_id" value="' . $rowid . '">';
     print '<input type="hidden" name="rowid" value="' . $rowid . '">';
     print '<input type="hidden" name="socid" value="' . $socid . '">';
 } else {
     $events = array();
     $events[] = array('method' => 'getVatRates', 'url' => dol_buildpath('/core/ajax/vatrates.php', 1), 'htmlname' => 'tva_tx', 'params' => array());
     print $form->select_company(GETPOST("id_fourn"), 'id_fourn', 'fournisseur=1', 1, 0, 0, $events);
     $parameters = array('filtre' => "fournisseur=1", 'html_name' => 'id_fourn', 'selected' => GETPOST("id_fourn"), 'showempty' => 1, 'prod_id' => $object->id);
     $reshook = $hookmanager->executeHooks('formCreateThirdpartyOptions', $parameters, $object, $action);
     if (empty($reshook)) {
         if (empty($form->result)) {
             print ' - <a href="' . DOL_URL_ROOT . '/societe/soc.php?action=create&type=f&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=' . $action) . '">' . $langs->trans("CreateDolibarrThirdPartySupplier") . '</a>';
         }
     }
 }
 print '</td></tr>';
 // Ref supplier
 print '<tr><td class="fieldrequired">' . $langs->trans("SupplierRef") . '</td><td>';
 if ($rowid) {
     print $object->fourn_ref;
 } else {
     print '<input class="flat" name="ref_fourn" size="12" value="' . (GETPOST("ref_fourn") ? GETPOST("ref_fourn") : '') . '">';
Exemplo n.º 6
0
        print '</table>';
        if (is_object($objectsrc)) {
            print '<input type="hidden" name="origin"         value="' . $objectsrc->element . '">';
            print '<input type="hidden" name="originid"       value="' . $objectsrc->id . '">';
        }
        dol_fiche_end();
        print '<div class="center">';
        print '<input type="submit" class="button" value="' . $langs->trans("CreateDraftIntervention") . '">';
        print '</div>';
        print '</form>';
    } else {
        dol_fiche_head('');
        print '<form name="fichinter" action="' . $_SERVER['PHP_SELF'] . '" method="POST">';
        print '<table class="border" width="100%">';
        print '<tr><td class="fieldrequired">' . $langs->trans("ThirdParty") . '</td><td>';
        print $form->select_company('', 'socid', '', 1, 1);
        print '</td></tr>';
        print '</table>';
        dol_fiche_end();
        print '<div class="center">';
        print '<input type="hidden" name="action" value="create">';
        print '<input type="submit" class="button" value="' . $langs->trans("CreateDraftIntervention") . '">';
        print '</div>';
        print '</form>';
    }
} else {
    if ($id > 0 || !empty($ref)) {
        /*
         * Affichage en mode visu
         */
        $object->fetch($id, $ref);
Exemplo n.º 7
0
 /*
  * Confirmation de l'annulation
  */
 if ($action == 'cancel') {
     $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Cancel'), $langs->trans('ConfirmCancelOrder'), 'confirm_cancel', '', 0, 1);
 }
 /*
  * Confirmation de la suppression d'une ligne produit
  */
 if ($action == 'ask_deleteline') {
     $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
 }
 // Clone confirmation
 if ($action == 'clone') {
     // Create an array for form
     $formquestion = array(array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $html->select_company(GETPOST('socid'), 'socid', '(s.client=1 OR s.client=3)')));
     // Paiement incomplet. On demande si motif = escompte ou autre
     $formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneOrder'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
 }
 // Hook for external modules
 if (empty($formconfirm) && !empty($object->hooks)) {
     foreach ($object->hooks as $hook) {
         if (!empty($hook['modules'])) {
             foreach ($hook['modules'] as $module) {
                 if (empty($formconfirm) && method_exists($module, 'formconfirm')) {
                     $formconfirm = $module->formconfirm($action, $object, $lineid);
                 }
             }
         }
     }
 }
Exemplo n.º 8
0
         print '</form>';
     }
 } else {
     /*
      * View
      */
     $res = $object->fetch_optionals($object->id, $extralabels);
     //if ($res < 0) { dol_print_error($db); exit; }
     $head = societe_prepare_head($object);
     dol_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company');
     // Confirm delete third party
     if ($action == 'delete' || $conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) {
         print $form->formconfirm($_SERVER["PHP_SELF"] . "?socid=" . $object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete");
     }
     if ($action == 'merge') {
         $formquestion = array(array('name' => 'soc_origin', 'label' => $langs->trans('MergeOriginThirdparty'), 'type' => 'other', 'value' => $form->select_company('', 'soc_origin', 's.rowid != ' . $object->id, 1, 0, 0, array(), 0, 'minwidth200')));
         print $form->formconfirm($_SERVER["PHP_SELF"] . "?socid=" . $object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 190);
     }
     dol_htmloutput_errors($error, $errors);
     dol_banner_tab($object, 'socid', '', $user->societe_id ? 0 : 1, 'rowid', 'nom');
     print '<div class="fichecenter">';
     print '<div class="fichehalfleft">';
     print '<div class="underbanner clearboth"></div>';
     print '<table class="border tableforfield" width="100%">';
     // Alias names (commercial, trademark or alias names)
     print '<tr><td class="titlefield">' . $langs->trans('AliasNames') . '</td><td>';
     print $object->name_alias;
     print "</td></tr>";
     // Prospect/Customer
     print '<tr><td>' . $langs->trans('ProspectCustomer') . '</td><td>';
     print $object->getLibCustProspStatut();
Exemplo n.º 9
0
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($langs->trans("CashDeskSetup"), $linkback, 'title_setup');
print '<br>';
// Mode
$var = true;
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<input type="hidden" name="action" value="set">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Parameters") . '</td><td>' . $langs->trans("Value") . '</td>';
print "</tr>\n";
$var = !$var;
print '<tr ' . $bc[$var] . '><td width=\\"50%\\">' . $langs->trans("CashDeskThirdPartyForSell") . '</td>';
print '<td colspan="2">';
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3)', 1, 0, 1, array(), 0);
print '</td></tr>';
if (!empty($conf->banque->enabled)) {
    $var = !$var;
    print '<tr ' . $bc[$var] . '><td>' . $langs->trans("CashDeskBankAccountForSell") . '</td>';
    print '<td colspan="2">';
    $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH, 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", 1);
    print '</td></tr>';
    $var = !$var;
    print '<tr ' . $bc[$var] . '><td>' . $langs->trans("CashDeskBankAccountForCheque") . '</td>';
    print '<td colspan="2">';
    $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE, 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", 1);
    print '</td></tr>';
    $var = !$var;
    print '<tr ' . $bc[$var] . '><td>' . $langs->trans("CashDeskBankAccountForCB") . '</td>';
    print '<td colspan="2">';
Exemplo n.º 10
0
 print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
 print '<input type="hidden" name="action" value="add">';
 print '<input type="hidden" name="origin" value="' . GETPOST('origin') . '">';
 print '<input type="hidden" name="originid" value="' . GETPOST('originid') . '">';
 print '<table class="border" width="100%">';
 // Ref
 print '<tr><td>' . $langs->trans('Ref') . '</td><td>' . $langs->trans('Draft') . '</td></tr>';
 // Third party
 print '<tr><td class="fieldrequired">' . $langs->trans('Supplier') . '</td>';
 print '<td>';
 if ($_REQUEST['socid'] > 0) {
     print $societe->getNomUrl(1);
     print '<input type="hidden" name="socid" value="' . $_GET['socid'] . '">';
 } else {
     print $form->select_company(empty($_GET['socid']) ? '' : $_GET['socid'], 'socid', 's.fournisseur = 1', 1);
 }
 print '</td></tr>';
 // Ref supplier
 print '<tr><td class="fieldrequired">' . $langs->trans('RefSupplier') . '</td><td><input name="ref_supplier" value="' . (isset($_POST['ref_supplier']) ? $_POST['ref_supplier'] : '') . '" type="text"></td>';
 print '</tr>';
 print '<tr><td valign="top" class="fieldrequired">' . $langs->trans('Type') . '</td><td colspan="2">';
 print '<table class="nobordernopadding">' . "\n";
 // Standard invoice
 print '<tr height="18"><td width="16px" valign="middle">';
 print '<input type="radio" name="type" value="0"' . ($_POST['type'] == 0 ? ' checked="checked"' : '') . '>';
 print '</td><td valign="middle">';
 $desc = $form->textwithpicto($langs->trans("InvoiceStandardAsk"), $langs->transnoentities("InvoiceStandardDesc"), 1);
 print $desc;
 print '</td></tr>' . "\n";
 /*
Exemplo n.º 11
0
        require_once(DOL_DOCUMENT_ROOT ."/includes/modules/project/".$conf->global->PROJECT_ADDON.".php");
        $modProject = new $obj;
        $defaultref = $modProject->getNextValue($soc,$project);
    }

    if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';

    // Ref
    print '<tr><td><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td><input size="12" type="text" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$defaultref).'"></td></tr>';

    // Label
    print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td><td><input size="30" type="text" name="title" value="'.$_POST["title"].'"></td></tr>';

    // Customer
    print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
    $text=$html->select_company(GETPOST("socid"),'socid','',1,1);
    $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty");
    print $html->textwithtooltip($text.' '.img_help(),$texthelp,1);
    print '</td></tr>';

    // Public
    print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
    $array=array(0 => $langs->trans("PrivateProject"),1 => $langs->trans("SharedProject"));
    print $html->selectarray('public',$array,$project->public);
    print '</td></tr>';

    // Date start
    print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
    print $html->select_date('','project');
    print '</td></tr>';
Exemplo n.º 12
0
        dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');

        // Confirm delete third party
        if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)))
        {
            print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete");
        }

	    if ($action == 'merge')
	    {
		    $formquestion = array(
			    array(
				    'name' => 'soc_origin',
			    	'label' => $langs->trans('MergeOriginThirdparty'),
				    'type' => 'other',
				    'value' => $form->select_company('', 'soc_origin', 's.rowid != '.$object->id, 1, 0, 0, array(), 0, 'minwidth200')
			    )
		    );

		    print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 190);
	    }

        dol_htmloutput_errors($error,$errors);

        
        dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
        
        
        print '<div class="fichecenter">';
        print '<div class="fichehalfleft">';
        
Exemplo n.º 13
0
	});
});
</script>';
// Checkbox to select from free text
print '<input id="fillmanually" type="radio" ' . (!GETPOST("selectorforbarcode") || GETPOST("selectorforbarcode") == 'fillmanually' ? 'checked="checked" ' : '') . 'name="selectorforbarcode" value="fillmanually" class="radiobarcodeselect"> ' . $langs->trans("FillBarCodeTypeAndValueManually") . ' &nbsp; ';
print '<br>';
print '<input id="fillfromproduct" type="radio" ' . (GETPOST("selectorforbarcode") == 'fillfromproduct' ? 'checked="checked" ' : '') . 'name="selectorforbarcode" value="fillfromproduct" class="radiobarcodeselect"> ' . $langs->trans("FillBarCodeTypeAndValueFromProduct") . ' &nbsp; ';
print '<br>';
print '<div class="showforproductselector">';
$form->select_produits(GETPOST('productid'), 'productid', '');
print ' &nbsp; <input type="submit" id="submitproduct" name="submitproduct" class="button" value="' . dol_escape_htmltag($langs->trans("GetBarCode")) . '">';
print '</div>';
print '<input id="fillfromthirdparty" type="radio" ' . (GETPOST("selectorforbarcode") == 'fillfromthirdparty' ? 'checked="checked" ' : '') . 'name="selectorforbarcode" value="fillfromthirdparty" class="radiobarcodeselect"> ' . $langs->trans("FillBarCodeTypeAndValueFromThirdParty") . ' &nbsp; ';
print '<br>';
print '<div class="showforthirdpartyselector">';
print $form->select_company(GETPOST('socid'), 'socid', '', 1);
print ' &nbsp; <input type="submit" id="submitthirdparty" name="submitthirdparty" class="button showforthirdpartyselector" value="' . dol_escape_htmltag($langs->trans("GetBarCode")) . '">';
print '</div>';
print '<br>';
if ($producttmp->id > 0) {
    print $langs->trans("BarCodeDataForProduct", $producttmp->getNomUrl(1)) . '<br>';
}
if ($thirdpartytmp->id > 0) {
    print $langs->trans("BarCodeDataForThirdparty", $thirdpartytmp->getNomUrl(1)) . '<br>';
}
print '<div class="tagtable">';
// Barcode type
print '	<div class="tagtr">';
print '	<div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
print $langs->trans("BarcodeType") . ' &nbsp; ';
print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
 readfile(dol_buildpath('/fullcalendar/lib/moment/min/moment.min.js'));
 readfile(dol_buildpath('/fullcalendar/lib/fullcalendar/dist/fullcalendar.min.js'));
 if (!is_file(dol_buildpath('/fullcalendar/lib/fullcalendar/dist/lang/' . $langjs . '.js'))) {
     $langjs = 'en-gb';
 }
 readfile(dol_buildpath('/fullcalendar/lib/fullcalendar/dist/lang/' . $langjs . '.js'));
 if (!empty($user->array_options['options_googlecalendarapi'])) {
     //	readfile(dol_buildpath('/fullcalendar/lib/fullcalendar/dist/fullcalendar/gcal.js'));
 }
 ob_start();
 $formactions = new FormActions($db);
 $formactions->select_type_actions(-1, "type_code", "systemauto");
 $select_type_action = ob_get_clean();
 $form = new Form($db);
 //$select_company = $form->select_thirdparty('','fk_soc','',1,1,0);
 $select_company = $form->select_company('', 'fk_soc', '', 1);
 $select_user = $form->select_dolusers($user->id, 'fk_user');
 ob_start();
 $form->select_contacts(-1, -1, 'contactid', 1, '', '', 0, 'minwidth200');
 // contactid car nom non pris en compte par l'ajax en vers.<3.9
 $select_contact = ob_get_clean();
 ob_start();
 $formProject = new FormProjets($db);
 $select_project = $formProject->select_projects_list(-1, 0, 'fk_project', 0, 0, 1);
 $select_project .= ob_get_clean();
 $defaultDay = date('d');
 if (!empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)) {
     list($hourStart, $hourEnd) = explode('-', $conf->global->MAIN_DEFAULT_WORKING_HOURS);
 }
 if (empty($hourStart)) {
     $hourStart = 8;
Exemplo n.º 15
0
//if (empty($socid))
//{
// Show filter box
print '<form name="stats" method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
print '<input type="hidden" name="mode" value="' . $mode . '">';
print '<table class="border" width="100%">';
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">' . $langs->trans("Filter") . '</td></tr>';
// Company
print '<tr><td align="left">' . $langs->trans("ThirdParty") . '</td><td align="left">';
if ($mode == 'customer') {
    $filter = 's.client in (1,2,3)';
}
if ($mode == 'supplier') {
    $filter = 's.fournisseur = 1';
}
print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"');
print '</td></tr>';
// User
print '<tr><td align="left">' . $langs->trans("CreatedBy") . '</td><td align="left">';
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td></tr>';
// Year
print '<tr><td align="left">' . $langs->trans("Year") . '</td><td align="left">';
if (!in_array($year, $arrayyears)) {
    $arrayyears[$year] = $year;
}
if (!in_array($nowyear, $arrayyears)) {
    $arrayyears[$nowyear] = $nowyear;
}
arsort($arrayyears);
print $form->selectarray('year', $arrayyears, $year, 0);
Exemplo n.º 16
0
 print '</table>';
 print '<br><br>';
 print '<table class="border" width="100%">';
 // Societe, contact
 print '<tr><td width="30%" class="nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>';
 if (GETPOST('socid', 'int') > 0) {
     $societe = new Societe($db);
     $societe->fetch(GETPOST('socid', 'int'));
     print $societe->getNomUrl(1);
     print '<input type="hidden" name="socid" value="' . GETPOST('socid', 'int') . '">';
 } else {
     $events = array();
     $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
     //For external user force the company to user company
     if (!empty($user->societe_id)) {
         print $form->select_company($user->societe_id, 'socid', '', 1, 1, 0, $events);
     } else {
         print $form->select_company('', 'socid', '', 1, 1, 0, $events);
     }
 }
 print '</td></tr>';
 print '<tr><td class="nowrap">' . $langs->trans("ActionOnContact") . '</td><td>';
 $form->select_contacts(GETPOST('socid', 'int'), GETPOST('contactid'), 'contactid', 1);
 print '</td></tr>';
 // Project
 if (!empty($conf->projet->enabled)) {
     $formproject = new FormProjets($db);
     // Projet associe
     $langs->load("projects");
     print '<tr><td valign="top">' . $langs->trans("Project") . '</td><td>';
     $numproject = $formproject->select_projects(!empty($societe->id) ? $societe->id : 0, GETPOST("projectid") ? GETPOST("projectid") : '', 'projectid');
Exemplo n.º 17
0
		<td colspan="2">
		&nbsp;
		</td>
	</tr>

<?php 
print "<tr>";
print '<td class="label1">' . $langs->trans("CashDeskThirdPartyForSell") . '</td>';
print '<td>';
$disabled = 0;
$langs->load("companies");
if (!empty($conf->global->CASHDESK_ID_THIRDPARTY)) {
    $disabled = 1;
}
// If a particular third party is defined, we disable choice
print $form->select_company(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : $conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3)', !$disabled, $disabled, 1);
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
print '</td>';
print "</tr>\n";
if (!empty($conf->stock->enabled)) {
    $langs->load("stocks");
    print "<tr>";
    print '<td class="label1">' . $langs->trans("Warehouse") . '</td>';
    print '<td>';
    $disabled = 0;
    if (!empty($conf->global->CASHDESK_ID_WAREHOUSE)) {
        $disabled = 1;
    }
    // If a particular stock is defined, we disable choice
    print $formproduct->selectWarehouses(GETPOST('warehouseid') ? GETPOST('warehouseid') : (empty($conf->global->CASHDESK_ID_WAREHOUSE) ? 'ifone' : $conf->global->CASHDESK_ID_WAREHOUSE), 'warehouseid', '', !$disabled, $disabled);
    //print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
Exemplo n.º 18
0
 if (!empty($search_soc)) {
     $filter['soc.nom'] = $search_soc;
 }
 if ($action == 'add_customer_price') {
     // Create mode
     $maxpricesupplier = $object->min_recommended_price();
     print_fiche_titre($langs->trans('PriceByCustomer'));
     print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
     print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
     print '<input type="hidden" name="action" value="add_customer_price_confirm">';
     print '<input type="hidden" name="id" value="' . $object->id . '">';
     print '<table class="border" width="100%">';
     print '<tr>';
     print '<td>' . $langs->trans('ThirdParty') . '</td>';
     print '<td>';
     print $form->select_company('', 'socid', 's.client in (1,2,3) AND s.rowid NOT IN (SELECT fk_soc FROM ' . MAIN_DB_PREFIX . 'product_customer_price WHERE fk_product=' . $object->id . ')', 1, 0, 0, array(), 0, 'minwidth300');
     print '</td>';
     print '</tr>';
     // VAT
     print '<tr><td>' . $langs->trans("VATRate") . '</td><td>';
     print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr);
     print '</td></tr>';
     // Price base
     print '<tr><td width="15%">';
     print $langs->trans('PriceBase');
     print '</td>';
     print '<td>';
     print $form->selectPriceBaseType($object->price_base_type, "price_base_type");
     print '</td>';
     print '</tr>';
     // Price
Exemplo n.º 19
0
 }
 if ($filefound) {
     $result = dol_include_once($reldir . "core/modules/project/" . $modele . '.php');
     $modProject = new $classname();
     $defaultref = $modProject->getNextValue($thirdparty, $object);
 }
 if (is_numeric($defaultref) && $defaultref <= 0) {
     $defaultref = '';
 }
 // Ref
 print '<tr><td><span class="fieldrequired">' . $langs->trans("Ref") . '</span></td><td><input size="12" type="text" name="ref" value="' . ($_POST["ref"] ? $_POST["ref"] : $defaultref) . '"></td></tr>';
 // Label
 print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td><td><input size="30" type="text" name="title" value="' . $_POST["title"] . '"></td></tr>';
 // Customer
 print '<tr><td>' . $langs->trans("ThirdParty") . '</td><td>';
 $text = $form->select_company(GETPOST('socid', 'int'), 'socid', '', 1, 1);
 $texthelp = $langs->trans("IfNeedToUseOhterObjectKeepEmpty");
 print $form->textwithtooltip($text . ' ' . img_help(), $texthelp, 1);
 print '</td></tr>';
 // Public
 print '<tr><td>' . $langs->trans("Visibility") . '</td><td>';
 $array = array(0 => $langs->trans("PrivateProject"), 1 => $langs->trans("SharedProject"));
 print $form->selectarray('public', $array, $object->public);
 print '</td></tr>';
 // Date start
 print '<tr><td>' . $langs->trans("DateStart") . '</td><td>';
 print $form->select_date($date_start ? $date_start : '', 'projectstart');
 print '</td></tr>';
 // Date end
 print '<tr><td>' . $langs->trans("DateEnd") . '</td><td>';
 print $form->select_date($date_end ? $date_end : -1, 'projectend');
Exemplo n.º 20
0
$selected = 3;
print $form->selectarray('testselecta', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1);
print '<br><br>';
print "Test 4b: a select<br>\n";
$array = array(1 => 'Value 1', 2 => 'Value 2', 3 => 'Value 3');
$selected = 3;
print $form->selectarray('testselectb', $array, $selected, 1, 0, 0, 'style="min-width: 250px;"', 0, 0, 0, '', '', 1);
print '<br><br>' . "\n";
print "Test 4c: Select array with no js forced<br>\n";
$array = array(1 => 'Value 1', 2 => 'Value 2', 3 => 'Value 3');
print $form->selectarray('selectarray', $array);
print '<br><br>' . "\n";
print "Test 4d: a select with ajax refresh and with onchange call of url<br>\n";
$selected = -1;
print $form->selectArrayAjax('testselectc', DOL_URL_ROOT . '/core/ajax/selectsearchbox.php', $selected, 'style="min-width: 250px;"', '', 0, 1, '', 1);
print '<br><br>' . "\n";
// Test5a: form->select_thirdparty
print "Test 5a: Select thirdparty<br>\n";
print $form->select_company(0, 'thirdpartytest');
print '<br><br>' . "\n";
// Test5b: form->select_product
print "Test 5b: Select product (using ajax)<br>\n";
$form->select_produits(0, 'producttest');
print '<br><br>' . "\n";
// Test5c: a multiselect
print "Test 5c: a multiselect<br>\n";
$array = array(1 => 'Value 1', 2 => 'Value 2', 3 => 'Value 3');
$arrayselected = array(1, 3);
print $form->multiselectarray('testmulti', $array, $arrayselected, '', 0, '', 0, 250);
llxFooter();
$db->close();
Exemplo n.º 21
0
     print $langs->trans("LinkedToDolibarrThirdParty");
     print '</td>';
     if ($action != 'editthirdparty' && $user->rights->adherent->creer) {
         print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editthirdparty&amp;rowid=' . $object->id . '">' . img_edit($langs->trans('SetLinkToThirdParty'), 1) . '</a></td>';
     }
     print '</tr></table>';
     print '</td><td colspan="2" class="valeur">';
     if ($action == 'editthirdparty') {
         $htmlname = 'socid';
         print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '" name="form' . $htmlname . '">';
         print '<input type="hidden" name="rowid" value="' . $object->id . '">';
         print '<input type="hidden" name="action" value="set' . $htmlname . '">';
         print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
         print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
         print '<tr><td>';
         print $form->select_company($object->fk_soc, 'socid', '', 1);
         print '</td>';
         print '<td align="left"><input type="submit" class="button" value="' . $langs->trans("Modify") . '"></td>';
         print '</tr></table></form>';
     } else {
         if ($object->fk_soc) {
             $company = new Societe($db);
             $result = $company->fetch($object->fk_soc);
             print $company->getNomUrl(1);
         } else {
             print $langs->trans("NoThirdPartyAssociatedToMember");
         }
     }
     print '</td></tr>';
 }
 // Login Dolibarr
Exemplo n.º 22
0
 $search_soc = GETPOST('search_soc');
 if (!empty($search_soc)) {
     $filter['soc.nom'] = $search_soc;
 }
 if ($action == 'add_customer_price') {
     // Create mode
     print_fiche_titre($langs->trans('PriceByCustomer'));
     print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">';
     print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
     print '<input type="hidden" name="action" value="add_customer_price_confirm">';
     print '<input type="hidden" name="id" value="' . $object->id . '">';
     print '<table class="border" width="100%">';
     print '<tr>';
     print '<td>' . $langs->trans('ThirdParty') . '</td>';
     print '<td>';
     print $form->select_company('', 'socid', 's.rowid NOT IN (SELECT fk_soc FROM ' . MAIN_DB_PREFIX . 'product_customer_price WHERE fk_product=' . $object->id . ')', 1);
     print '</td>';
     print '</tr>';
     // VAT
     print '<tr><td>' . $langs->trans("VATRate") . '</td><td>';
     print $form->load_tva("tva_tx", $object->tva_tx, $mysoc, '', $object->id, $object->tva_npr);
     print '</td></tr>';
     // Price base
     print '<tr><td width="15%">';
     print $langs->trans('PriceBase');
     print '</td>';
     print '<td>';
     print $form->select_PriceBaseType($object->price_base_type, "price_base_type");
     print '</td>';
     print '</tr>';
     // Price
Exemplo n.º 23
0
$head[$h][2] = 'byyear';
$h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'propal_stats');
dol_fiche_head($head, 'byyear', $langs->trans("Statistics"));
print '<div class="fichecenter"><div class="fichethirdleft">';
//if (empty($socid))
//{
// Show filter box
print '<form name="stats" method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
print '<input type="hidden" name="mode" value="' . $mode . '">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">' . $langs->trans("Filter") . '</td></tr>';
// Company
print '<tr><td align="left">' . $langs->trans("ThirdParty") . '</td><td align="left">';
$filter = 's.client in (1,2,3)';
print $form->select_company($socid, 'socid', $filter, 1);
print '</td></tr>';
// User
print '<tr><td align="left">' . $langs->trans("CreatedBy") . '</td><td align="left">';
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '</td></tr>';
// Status
print '<tr><td align="left">' . $langs->trans("Status") . '</td><td align="left">';
$formpropal->selectProposalStatus($object_statut, 0, 1);
print '</td></tr>';
// Year
print '<tr><td align="left">' . $langs->trans("Year") . '</td><td align="left">';
if (!in_array($year, $arrayyears)) {
    $arrayyears[$year] = $year;
}
if (!in_array($nowyear, $arrayyears)) {
Exemplo n.º 24
0
 dol_fiche_head($head, 'card', $title, 0, 'contact');
 print '<table class="border" width="100%">';
 // Ref
 print '<tr><td>' . $langs->trans("Ref") . '</td><td colspan="3">';
 print $object->ref;
 print '</td></tr>';
 // Lastname
 print '<tr><td width="20%" class="fieldrequired"><label for="lastname">' . $langs->trans("Lastname") . ' / ' . $langs->trans("Label") . '</label></td>';
 print '<td width="30%"><input name="lastname" id="lastname" type="text" size="20" maxlength="80" value="' . (isset($_POST["lastname"]) ? $_POST["lastname"] : $object->lastname) . '" autofocus="autofocus"></td>';
 print '<td width="20%"><label for="firstname">' . $langs->trans("Firstname") . '</label></td>';
 print '<td width="30%"><input name="firstname" id="firstname" type="text" size="20" maxlength="80" value="' . (isset($_POST["firstname"]) ? $_POST["firstname"] : $object->firstname) . '"></td></tr>';
 // Company
 if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
     print '<tr><td><label for="socid">' . $langs->trans("ThirdParty") . '</label></td>';
     print '<td colspan="3" class="maxwidthonsmartphone">';
     print $form->select_company(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : ($object->socid ? $object->socid : -1), 'socid', '', 1);
     print '</td>';
     print '</tr>';
 }
 // 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 '</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>';
 // 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++;
Exemplo n.º 25
0
 }
 print '<tr><td class="fieldrequired">' . $langs->trans('Ref') . '</td><td colspan="2">' . $tmpcode . '</td></tr>';
 // Ref supplier
 print '<tr><td>' . $langs->trans('RefSupplier') . '</td>';
 print '<td colspan="2"><input type="text" size="5" name="ref_supplier" id="ref_supplier" value="' . GETPOST('ref_supplier', 'alpha') . '"></td></tr>';
 // Customer
 print '<tr>';
 print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
 if ($socid > 0) {
     print '<td colspan="2">';
     print $soc->getNomUrl(1);
     print '<input type="hidden" name="socid" value="' . $soc->id . '">';
     print '</td>';
 } else {
     print '<td colspan="2">';
     print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1);
     print '</td>';
 }
 print '</tr>' . "\n";
 if ($socid > 0) {
     // Ligne info remises tiers
     print '<tr><td>' . $langs->trans('Discounts') . '</td><td colspan="2">';
     if ($soc->remise_percent) {
         print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent);
     } else {
         print $langs->trans("CompanyHasNoRelativeDiscount");
     }
     print '. ';
     $absolute_discount = $soc->getAvailableDiscounts();
     if ($absolute_discount) {
         print $langs->trans("CompanyHasAbsoluteDiscount", price($absolute_discount), $langs->trans("Currency" . $conf->currency));
Exemplo n.º 26
0
    // Mode payment Bank
    print '<tr><td valign="top" >' . $langs->trans("ModePaymentBankExtra") . '</td>';
    print '<td colspan="3">';
    print $form->select_types_paiements(isset($_POST["modebank_extra"]) ? $_POST["modebank_extra"] : 0, 'modebank_extra', '', 0);
    print '</td></tr>';
    if ($conf->stock->enabled) {
        //Stock
        print '<tr><td valign="top" class="fieldrequired">' . $langs->trans("CashDeskIdWareHouse") . '</td>';
        print '<td colspan="2">';
        print $formproduct->selectWarehouses(isset($_POST["stock"]) ? $_POST["stock"] : 1, 'stock', '', 1);
        print '</td></tr>';
    }
    //Soc
    print '<tr><td valign="top" class="fieldrequired">' . $langs->trans("CashDeskThirdPartyForSell") . '</td>';
    print '<td colspan="3">';
    print $form->select_company(isset($_POST["soc"]) ? $_POST["soc"] : 1, 'soc', 's.client=1 or s.client=3', 1, 1);
    print '</td></tr>';
    print '<tr><td align="center" colspan="4"><input value="' . $langs->trans("CreateCash") . '" type="submit" class="button"></td></tr>';
    print '</form>';
    print '</table>';
} else {
    if (($id || $ref) && $action != 'edit') {
        $cash = new Cash($db);
        $cash->fetch($id, $ref);
        /*
         * Affichage onglets
         */
        // Onglets
        $head = cash_prepare_head($cash);
        dol_fiche_head($head, 'cashname', $langs->trans("Cash"), 0, 'barcode');
        /*
Exemplo n.º 27
0
 $form->select_type_fees(GETPOST('type', 'int'), 'type', 1);
 print '</td></tr>';
 print "<tr>";
 print '<td class="fieldrequired">' . $langs->trans("Person") . '</td><td>';
 print $form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
 print '</td></tr>';
 print "<tr>";
 print '<td class="fieldrequired">' . $langs->trans("Date") . '</td><td>';
 print $form->select_date($datec ? $datec : -1, '', '', '', '', 'add', 1, 1, 1);
 print '</td></tr>';
 // Km
 print '<tr><td class="fieldrequired">' . $langs->trans("FeesKilometersOrAmout") . '</td><td><input name="km" size="10" value="' . GETPOST("km") . '"></td></tr>';
 // Company
 print "<tr>";
 print '<td>' . $langs->trans("CompanyVisited") . '</td><td>';
 print $form->select_company(GETPOST('socid', 'int'), 'socid', '', 1);
 print '</td></tr>';
 // Public note
 print '<tr>';
 print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
 print '<td valign="top" colspan="2">';
 $doleditor = new DolEditor('note_public', GETPOST('note_public', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, 100);
 print $doleditor->Create(1);
 print '</td></tr>';
 // Private note
 if (empty($user->societe_id)) {
     print '<tr>';
     print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
     print '<td valign="top" colspan="2">';
     $doleditor = new DolEditor('note_private', GETPOST('note_private', 'alpha'), '', 200, 'dolibarr_notes', 'In', false, true, true, ROWS_8, 100);
     print $doleditor->Create(1);
Exemplo n.º 28
0
 $cond_reglement_id = $societe->cond_reglement_supplier_id;
 $mode_reglement_id = $societe->mode_reglement_supplier_id;
 print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="post">';
 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
 print '<input type="hidden" name="action" value="add">';
 print '<table class="border" width="100%">';
 // Ref
 print '<tr><td>' . $langs->trans('Ref') . '</td><td>' . $langs->trans('Draft') . '</td></tr>';
 // Third party
 print '<tr><td class="fieldrequired">' . $langs->trans('Supplier') . '</td>';
 print '<td>';
 if ($socid > 0) {
     print $societe->getNomUrl(1);
     print '<input type="hidden" name="socid" value="' . $socid . '">';
 } else {
     print $form->select_company(empty($socid) ? '' : $socid, 'socid', 's.fournisseur = 1', 1);
 }
 print '</td>';
 // Ref supplier
 print '<tr><td>' . $langs->trans('RefSupplier') . '</td><td><input name="refsupplier" type="text"></td>';
 print '</tr>';
 print '</td></tr>';
 // Payment term
 print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">';
 $form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id');
 print '</td></tr>';
 // Payment mode
 print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">';
 $form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id');
 print '</td></tr>';
 print '<tr><td>' . $langs->trans('NotePublic') . '</td>';
Exemplo n.º 29
0
        print '<input type="hidden" name="socid" value="' . $soc->id . '">';
        // Outstanding Bill
        $outstandingBills = $soc->get_OutstandingBill();
        print ' (' . $langs->trans('CurrentOutstandingBill') . ': ';
        print price($outstandingBills, '', $langs, 0, 0, -1, $conf->currency);
        if ($soc->outstanding_limit != '') {
            if ($outstandingBills > $soc->outstanding_limit) {
                print img_warning($langs->trans("OutstandingBillReached"));
            }
            print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency);
        }
        print ')';
        print '</td>';
    } else {
        print '<td colspan="2">';
        print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 1);
        // Option to reload page to retrieve customer informations. Note, this clear other input
        if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE)) {
            print '<script type="text/javascript">
			$(document).ready(function() {
				$("#socid").change(function() {
					var socid = $(this).val();
					// reload page
					window.location.href = "' . $_SERVER["PHP_SELF"] . '?action=create&socid="+socid;
				});
			});
			</script>';
        }
        print '</td>';
    }
    print '</tr>' . "\n";
Exemplo n.º 30
0
function _fiche(&$PDOdb, &$assetOf, $mode = 'edit', $fk_product_to_add = 0, $fk_nomenclature = 0)
{
    global $langs, $db, $conf, $user, $hookmanager;
    /***************************************************
     * PAGE
     *
     * Put here all code to build page
     ****************************************************/
    $parameters = array('id' => $assetOf->getId());
    $reshook = $hookmanager->executeHooks('doActions', $parameters, $assetOf, $mode);
    // Note that $action and $object may have been modified by hook
    //pre($assetOf,true);
    llxHeader('', $langs->trans('OFAsset'), '', '');
    print dol_get_fiche_head(ofPrepareHead($assetOf, 'assetOF'), 'fiche', $langs->trans('OFAsset'));
    ?>
<style type="text/css">
		#assetChildContener .OFMaster {
			
			background:#fff;
			-webkit-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.52);
			-moz-box-shadow:    4px 4px 5px 0px rgba(50, 50, 50, 0.52);
			box-shadow:         4px 4px 5px 0px rgba(50, 50, 50, 0.52);
			
			margin-bottom:20px;
		}
		
	</style>
		<div class="OFContent" rel="<?php 
    echo $assetOf->getId();
    ?>
">	<?php 
    $TPrixFournisseurs = array();
    //$form=new TFormCore($_SERVER['PHP_SELF'],'formeq'.$assetOf->getId(),'POST');
    //Affichage des erreurs
    if (!empty($assetOf->errors)) {
        ?>
		<br><div class="error">
		<?php 
        foreach ($assetOf->errors as $error) {
            echo $error . "<br>";
            setEventMessage($error, 'errors');
        }
        $assetOf->errors = array();
        ?>
		</div><br>
		<?php 
    }
    $form = new TFormCore();
    $form->Set_typeaff($mode);
    $doliform = new Form($db);
    if (!empty($_REQUEST['fk_product'])) {
        echo $form->hidden('fk_product', $_REQUEST['fk_product']);
    }
    $TBS = new TTemplateTBS();
    $liste = new TListviewTBS('asset');
    $TBS->TBS->protect = false;
    $TBS->TBS->noerr = true;
    $PDOdb = new TPDOdb();
    $TNeeded = array();
    $TToMake = array();
    $TNeeded = _fiche_ligne($form, $assetOf, "NEEDED");
    $TToMake = _fiche_ligne($form, $assetOf, "TO_MAKE");
    $TIdCommandeFourn = $assetOf->getElementElement($PDOdb);
    $HtmlCmdFourn = '';
    if (count($TIdCommandeFourn)) {
        foreach ($TIdCommandeFourn as $idcommandeFourn) {
            $cmd = new CommandeFournisseur($db);
            $cmd->fetch($idcommandeFourn);
            $HtmlCmdFourn .= $cmd->getNomUrl(1) . " - " . $cmd->getLibStatut(0);
        }
    }
    ob_start();
    $doliform->select_produits('', 'fk_product', '', $conf->product->limit_size, 0, -1, 2, '', 3, array());
    $select_product = ob_get_clean();
    $Tid = array();
    //$Tid[] = $assetOf->rowid;
    if ($assetOf->getId() > 0) {
        $assetOf->getListeOFEnfants($PDOdb, $Tid);
    }
    $TWorkstation = array();
    foreach ($assetOf->TAssetWorkstationOF as $k => &$TAssetWorkstationOF) {
        $ws =& $TAssetWorkstationOF->ws;
        $TWorkstation[] = array('libelle' => '<a href="' . dol_buildpath('workstation/workstation.php?id=' . $ws->rowid . '&action=view', 2) . '">' . $ws->name . '</a>', 'fk_user' => visu_checkbox_user($PDOdb, $form, $ws->fk_usergroup, $TAssetWorkstationOF->users, 'TAssetWorkstationOF[' . $k . '][fk_user][]', $assetOf->status), 'fk_project_task' => visu_project_task($db, $TAssetWorkstationOF->fk_project_task, $form->type_aff, 'TAssetWorkstationOF[' . $k . '][progress]'), 'fk_task' => visu_checkbox_task($PDOdb, $form, $TAssetWorkstationOF->fk_asset_workstation, $TAssetWorkstationOF->tasks, 'TAssetWorkstationOF[' . $k . '][fk_task][]', $assetOf->status), 'nb_hour' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_hour]', $TAssetWorkstationOF->nb_hour, 3, 10) : ($conf->global->ASSET_USE_CONVERT_TO_TIME ? convertSecondToTime($TAssetWorkstationOF->nb_hour * 3600) : price($TAssetWorkstationOF->nb_hour)), 'nb_hour_real' => $assetOf->status == 'OPEN' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_hour_real]', $TAssetWorkstationOF->nb_hour_real, 3, 10) : ($conf->global->ASSET_USE_CONVERT_TO_TIME ? convertSecondToTime($TAssetWorkstationOF->nb_hour_real * 3600) : price($TAssetWorkstationOF->nb_hour_real)), 'nb_days_before_beginning' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_days_before_beginning]', $TAssetWorkstationOF->nb_days_before_beginning, 3, 10) : $TAssetWorkstationOF->nb_days_before_beginning, 'delete' => $mode == 'edit' && $assetOf->status == 'DRAFT' ? '<a href="javascript:deleteWS(' . $assetOf->getId() . ',' . $TAssetWorkstationOF->getId() . ');">' . img_picto('Supprimer', 'delete.png') . '</a>' : '', 'note_private' => $assetOf->status == 'DRAFT' && $mode == 'edit' ? $form->zonetexte('', 'TAssetWorkstationOF[' . $k . '][note_private]', $TAssetWorkstationOF->note_private, 50, 1) : $TAssetWorkstationOF->note_private, 'rang' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][rang]', $TAssetWorkstationOF->rang, 3, 10) : $TAssetWorkstationOF->rang, 'id' => $ws->getId());
    }
    $client = new Societe($db);
    if ($assetOf->fk_soc > 0) {
        $client->fetch($assetOf->fk_soc);
    }
    $commande = new Commande($db);
    if ($assetOf->fk_commande > 0) {
        $commande->fetch($assetOf->fk_commande);
    }
    $TOFParent = array_merge(array(0 => ''), $assetOf->getCanBeParent($PDOdb));
    $hasParent = false;
    if (!empty($assetOf->fk_assetOf_parent)) {
        $TAssetOFParent = new TAssetOF();
        $TAssetOFParent->load($PDOdb, $assetOf->fk_assetOf_parent);
        $hasParent = true;
    }
    $parameters = array('id' => $assetOf->getId());
    $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $assetOf, $mode);
    // Note that $action and $object may have been modified by hook
    if ($fk_product_to_add > 0) {
        $product_to_add = new Product($db);
        $product_to_add->fetch($fk_product_to_add);
        $link_product_to_add = $product_to_add->getNomUrl(1) . ' ' . $product_to_add->label;
        $quantity_to_create = $form->texte('', 'quantity_to_create', 1, 3, 255);
    } else {
        $link_product_to_add = '';
        $quantity_to_create = '';
    }
    print $TBS->render('tpl/fiche_of.tpl.php', array('TNeeded' => $TNeeded, 'TTomake' => $TToMake, 'workstation' => $TWorkstation), array('assetOf' => array('id' => $assetOf->getId(), 'numero' => $assetOf->getId() > 0 ? '<a href="fiche_of.php?id=' . $assetOf->getId() . '">' . $assetOf->getNumero($PDOdb) . '</a>' : $assetOf->getNumero($PDOdb), 'ordre' => $form->combo('', 'ordre', TAssetOf::$TOrdre, $assetOf->ordre), 'fk_commande' => $assetOf->fk_commande == 0 ? '' : $commande->getNomUrl(1), 'commande_fournisseur' => $HtmlCmdFourn, 'date_besoin' => $form->calendrier('', 'date_besoin', $assetOf->date_besoin, 12, 12), 'date_lancement' => $form->calendrier('', 'date_lancement', $assetOf->date_lancement, 12, 12), 'temps_estime_fabrication' => price($assetOf->temps_estime_fabrication, 0, '', 1, -1, 2), 'temps_reel_fabrication' => price($assetOf->temps_reel_fabrication, 0, '', 1, -1, 2), 'fk_soc' => $mode == 'edit' ? $doliform->select_company($assetOf->fk_soc, 'fk_soc', 'client=1', 1) : ($client->id ? $client->getNomUrl(1) : ''), 'fk_project' => custom_select_projects(-1, $assetOf->fk_project, 'fk_project', $mode), 'note' => $form->zonetexte('', 'note', $assetOf->note, 80, 5), 'quantity_to_create' => $quantity_to_create, 'product_to_create' => $link_product_to_add, 'status' => $form->combo('', 'status', TAssetOf::$TStatus, $assetOf->status), 'statustxt' => TAssetOf::$TStatus[$assetOf->status], 'idChild' => !empty($Tid) ? '"' . implode('","', $Tid) . '"' : '', 'url' => dol_buildpath('/of/fiche_of.php', 2), 'url_liste' => $assetOf->getId() ? dol_buildpath('/of/fiche_of.php?id=' . $assetOf->getId(), 2) : dol_buildpath('/of/liste_of.php', 2), 'fk_product_to_add' => $fk_product_to_add, 'fk_nomenclature' => $fk_nomenclature, 'fk_assetOf_parent' => $assetOf->fk_assetOf_parent ? $assetOf->fk_assetOf_parent : '', 'link_assetOf_parent' => $hasParent ? '<a href="' . dol_buildpath('/of/fiche_of.php?id=' . $TAssetOFParent->rowid, 2) . '">' . $TAssetOFParent->numero . '</a>' : '', 'total_cost' => price($assetOf->total_cost, 0, '', 1, -1, 2), 'total_estimated_cost' => price($assetOf->total_estimated_cost, 0, '', 1, -1, 2), 'mo_cost' => price($assetOf->mo_cost, 0, '', 1, -1, 2), 'mo_estimated_cost' => price($assetOf->mo_estimated_cost, 0, '', 1, -1, 2), 'compo_cost' => price($assetOf->compo_cost, 0, '', 1, -1, 2), 'compo_estimated_cost' => price($assetOf->compo_estimated_cost, 0, '', 1, -1, 2), 'current_cost_for_to_make' => price($assetOf->current_cost_for_to_make, 0, '', 1, -1, 2)), 'view' => array('mode' => $mode, 'status' => $assetOf->status, 'allow_delete_of_finish' => $user->rights->of->of->allow_delete_of_finish, 'ASSET_USE_MOD_NOMENCLATURE' => (int) $conf->nomenclature->enabled, 'OF_MINIMAL_VIEW_CHILD_OF' => (int) $conf->global->OF_MINIMAL_VIEW_CHILD_OF, 'select_product' => $select_product, 'select_workstation' => $form->combo('', 'fk_asset_workstation', TWorkstation::getWorstations($PDOdb), -1), 'actionChild' => $mode == 'edit' ? __get('actionChild', 'edit') : __get('actionChild', 'view'), 'use_lot_in_of' => (int) (!empty($conf->asset->enabled) && !empty($conf->global->USE_LOT_IN_OF)), 'use_project_task' => (int) $conf->global->ASSET_USE_PROJECT_TASK, 'defined_user_by_workstation' => (int) $conf->global->ASSET_DEFINED_USER_BY_WORKSTATION, 'defined_task_by_workstation' => (int) $conf->global->ASSET_DEFINED_OPERATION_BY_WORKSTATION, 'defined_workstation_by_needed' => (int) $conf->global->ASSET_DEFINED_WORKSTATION_BY_NEEDED, 'defined_manual_wharehouse' => (int) $conf->global->ASSET_MANUAL_WAREHOUSE, 'hasChildren' => (int) (!empty($Tid)), 'user_id' => $user->id, 'workstation_module_activate' => (int) $conf->workstation->enabled, 'show_cost' => (int) $user->rights->of->of->price), 'rights' => array('show_ws_time' => $user->rights->of->of->show_ws_time)));
    echo $form->end_form();
    llxFooter('$Date: 2011/07/31 22:21:57 $ - $Revision: 1.19 $');
}