Exemple #1
0
     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>';
     }
     print '</td></tr>';
 }
 // Priority
 print '<tr><td class="nowrap" width="30%">' . $langs->trans("Priority") . '</td><td colspan="3">';
 print '<input type="text" name="priority" value="' . ($object->priority ? $object->priority : '') . '" size="5">';
 print '</td></tr>';
 // Object linked
 if (!empty($object->fk_element) && !empty($object->elementtype)) {
     include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
     print '<tr><td>' . $langs->trans("LinkedObject") . '</td>';
     print '<td colspan="3">' . dolGetElementUrl($object->fk_element, $object->elementtype, 1) . '</td></tr>';
 }
Exemple #2
0
 // 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', 'CRDT');
 print '</td></tr>';
 // Bank Account
 if (isset($_POST['fk_account'])) {
     $fk_account = $_POST['fk_account'];
 }
 print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
 $form->select_comptes($fk_account, 'fk_account', 0, '', 1);
 print '</td></tr>';
 // Project
 if (!empty($conf->projet->enabled) && $socid > 0) {
     $langs->load('projects');
     print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
     $numprojet = $formproject->select_projects($soc->id, $projectid, 'projectid', 0);
     print ' &nbsp; <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $soc->id) . '">' . $langs->trans("AddProject") . '</a>';
     print '</td></tr>';
 }
 // Incoterms
 if (!empty($conf->incoterm->enabled)) {
     print '<tr>';
     print '<td><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1) . '</label></td>';
     print '<td colspan="3" class="maxwidthonsmartphone">';
     print $form->select_incoterms(!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : '', !empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : '');
     print '</td></tr>';
 }
 // Other attributes
 $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by
Exemple #3
0
 }
 // Commercial suivi
 print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPFOLL") . '</span></td><td>';
 print $form->select_dolusers(GETPOST("commercial_suivi_id") ? GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, '');
 print '</td></tr>';
 // Commercial signature
 print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPSIGN") . '</span></td><td>';
 print $form->select_dolusers(GETPOST("commercial_signature_id") ? GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, '');
 print '</td></tr>';
 print '<tr><td><span class="fieldrequired">' . $langs->trans("Date") . '</span></td><td>';
 $form->select_date($datecontrat, '', 0, 0, '', "contrat");
 print "</td></tr>";
 if (!empty($conf->projet->enabled)) {
     $formproject = new FormProjets($db);
     print '<tr><td>' . $langs->trans("Project") . '</td><td>';
     $formproject->select_projects($soc->id, $projectid, "projectid");
     print "</td></tr>";
 }
 print '<tr><td>' . $langs->trans("NotePublic") . '</td><td valign="top">';
 $doleditor = new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70);
 print $doleditor->Create(1);
 if (empty($user->societe_id)) {
     print '<tr><td>' . $langs->trans("NotePrivate") . '</td><td valign="top">';
     $doleditor = new DolEditor('note_private', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70);
     print $doleditor->Create(1);
     print '</td></tr>';
 }
 // Other attributes
 $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by hook
    print "<tr>" . '<td>' . $langs->trans("EMail") . '</td><td><input type="text" name="email" size="40" value="' . $don->email . '"></td></tr>';
    print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>\n";
    if ($don->modepaiementid) {
        $selected = $don->modepaiementid;
    } else {
        $selected = '';
    }
    $form->select_types_paiements($selected, 'modepaiement', 'CRDT', 0, 1);
    print "</td></tr>\n";
    print "<tr>" . '<td>' . $langs->trans("Status") . '</td><td>' . $don->getLibStatut(4) . '</td></tr>';
    // Project
    if (!empty($conf->projet->enabled)) {
        $formproject = new FormProjets($db);
        $langs->load('projects');
        print '<tr><td>' . $langs->trans('Project') . '</td><td>';
        $formproject->select_projects(-1, isset($_POST["projectid"]) ? $_POST["projectid"] : $don->fk_project, 'projectid');
        print '</td></tr>';
    }
    // Other attributes
    $parameters = array('colspan' => ' colspan="1"');
    $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $don, $action);
    // Note that $action and $object may have been modified by hook
    print "</table>\n";
    print '<br><center><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '"></center>';
    print "</form>\n";
    print "</div>\n";
}
/* ************************************************************ */
/*                                                              */
/* Fiche don en mode visu                                       */
/*                                                              */
Exemple #5
0
         print '</a>';
     }
     print '</td>';
     print '</tr>';
 }
 if ($action == 'editline' && $objp->rowid == GETPOST('rowid')) {
     //modif ligne!!!!!
     print '<tr ' . $bc[$var] . '>';
     print '<td></td>';
     // Select date
     print '<td style="text-align:center;">';
     $form->select_date($objp->date, 'date');
     print '</td>';
     // Select project
     print '<td>';
     $formproject->select_projects(-1, $objp->fk_projet, 'fk_projet', 0, 0, 1, 1);
     print '</td>';
     // Select type
     print '<td style="text-align:center;">';
     select_type_fees_id($objp->type_fees_code, 'fk_c_type_fees');
     print '</td>';
     // Add comments
     print '<td>';
     print '<textarea class="flat_ndf" name="comments" class="centpercent">' . $objp->comments . '</textarea>';
     print '</td>';
     // VAT
     print '<td style="text-align:right;">';
     print $form->load_tva('vatrate', isset($_POST["vatrate"]) ? $_POST["vatrate"] : $objp->vatrate, $mysoc, '');
     print '</td>';
     // Unit price
     print '<td style="text-align:right;">';
Exemple #6
0
 $form->select_date($datedue, 'ech', '', '', '', "add", 1, 1);
 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', 'DBIT');
 print '</td></tr>';
 // Project
 if (!empty($conf->projet->enabled)) {
     $formproject = new FormProjets($db);
     $langs->load('projects');
     print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
     $formproject->select_projects(empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : '-1', $projectid, 'projectid', 0);
     print '</td></tr>';
 }
 // Incoterms
 if (!empty($conf->incoterm->enabled)) {
     print '<tr>';
     print '<td><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1) . '</label></td>';
     print '<td colspan="3" class="maxwidthonsmartphone">';
     print $form->select_incoterms(!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : '', !empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : '');
     print '</td></tr>';
 }
 // Bank Account
 print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
 $form->select_comptes($fk_account, 'fk_account', 0, '', 1);
 print '</td></tr>';
 // Public note
Exemple #7
0
 print '<tr><td class="tdtop">' . $langs->trans("Description") . '</td>';
 print '<td>';
 print '<textarea name="description" cols="80" rows="' . ROWS_3 . '">' . GETPOST('description') . '</textarea>';
 print '</td></tr>';
 // Project
 if (!empty($conf->projet->enabled)) {
     $formproject = new FormProjets($db);
     $langs->load("project");
     print '<tr><td>' . $langs->trans("Project") . '</td><td>';
     /* Fix: If a project must be linked to any companies (suppliers or not), project must be not be set as limited to customer but must be not linked to any particular thirdparty
        if ($societe->fournisseur==1)
        	$numprojet=select_projects(-1,$_POST["projectid"],'projectid');
        else
        	$numprojet=select_projects($societe->id,$_POST["projectid"],'projectid');
        	*/
     $numprojet = $formproject->select_projects($soc->id, GETPOST('projectid', 'int'), 'projectid');
     if ($numprojet == 0) {
         print ' &nbsp; <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>';
     }
     print '</td></tr>';
 }
 // Contract
 if ($conf->contrat->enabled) {
     $langs->load("contracts");
     print '<tr><td>' . $langs->trans("Contract") . '</td><td>';
     $numcontrat = $formcontract->select_contract($soc->id, GETPOST('contratid', 'int'), 'contratid', 0, 1);
     if ($numcontrat == 0) {
         print ' &nbsp; <a href="' . DOL_URL_ROOT . '/contrat/card.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddContract") . '</a>';
     }
     print '</td></tr>';
 }
Exemple #8
0
/**
 * Show filter form in agenda view
 *
 * @param	Object	$form			Form object
 * @param	int		$canedit		Can edit filter fields
 * @param	int		$status			Status
 * @param 	int		$year			Year
 * @param 	int		$month			Month
 * @param 	int		$day			Day
 * @param 	int		$showbirthday	Show birthday
 * @param 	string	$filtera		Filter on create by user
 * @param 	string	$filtert		Filter on assigned to user
 * @param 	string	$filterd		Filter of done by user
 * @param 	int		$pid			Product id
 * @param 	int		$socid			Third party id
 * @param	string	$action			Action string
 * @param	array	$showextcals	Array with list of external calendars (used to show links to select calendar), or -1 to show no legend
 * @param	string	$actioncode		Preselected value of actioncode for filter on type
 * @param	int		$usergroupid	Id of group to filter on users
 * @return	void
 */
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals = array(), $actioncode = '', $usergroupid = '')
{
    global $conf, $user, $langs, $db, $hookmanager;
    global $begin_h, $end_h, $begin_d, $end_d;
    $langs->load("companies");
    // Filters
    print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<input type="hidden" name="year" value="' . $year . '">';
    print '<input type="hidden" name="month" value="' . $month . '">';
    print '<input type="hidden" name="day" value="' . $day . '">';
    print '<input type="hidden" name="action" value="' . $action . '">';
    print '<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
    print '<div class="fichecenter">';
    if (!empty($conf->browser->phone)) {
        print '<div class="fichehalfleft">';
    } else {
        print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
    }
    print '<table class="nobordernopadding">';
    if ($canedit) {
        print '<tr>';
        print '<td class="nowrap">';
        print $langs->trans("ActionsToDoBy") . ' &nbsp; ';
        print '</td><td class="nowrap maxwidthonsmartphone">';
        print $form->select_dolusers($filtert, 'usertodo', 1, '', !$canedit);
        if (empty($conf->dol_optimize_smallscreen)) {
            print ' &nbsp; ' . $langs->trans("or") . ' ' . $langs->trans("Group") . ' &nbsp; ';
        }
        print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit);
        print '</td></tr>';
        include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
        $formactions = new FormActions($db);
        print '<tr>';
        print '<td class="nowrap">';
        print $langs->trans("Type");
        print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
        print $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0);
        print '</td></tr>';
        print '<tr>';
        print '<td class="nowrap">';
        print $langs->trans("Status");
        print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
        $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2);
        print '</td></tr>';
    }
    if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
        print '<tr>';
        print '<td class="nowrap">';
        print $langs->trans("ThirdParty") . ' &nbsp; ';
        print '</td><td class="nowrap maxwidthonsmartphone">';
        print $form->select_thirdparty($socid, 'socid');
        print '</td></tr>';
    }
    if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
        require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
        $formproject = new FormProjets($db);
        print '<tr>';
        print '<td class="nowrap">';
        print $langs->trans("Project") . ' &nbsp; ';
        print '</td><td class="nowrap maxwidthonsmartphone">';
        $formproject->select_projects($socid ? $socid : -1, $pid, 'projectid');
        print '</td></tr>';
    }
    if ($canedit && $action == 'show_peruser') {
        // Filter on hours
        print '<tr>';
        print '<td class="nowrap">' . $langs->trans("WorkingTimeRange") . '</td>';
        print "<td class='nowrap maxwidthonsmartphone'>";
        print '<input type="number" class="short" name="begin_h" value="' . $begin_h . '" min="0" max="23">';
        if (empty($conf->dol_use_jmobile)) {
            print ' - ';
        }
        print '<input type="number" class="short" name="end_h" value="' . $end_h . '" min="1" max="24">';
        if (empty($conf->dol_use_jmobile)) {
            print ' ' . $langs->trans("H");
        }
        print '</td></tr>';
        // Filter on days
        print '<tr>';
        print '<td class="nowrap">' . $langs->trans("WorkingDaysRange") . '</td>';
        print "<td class='nowrap maxwidthonsmartphone'>";
        print '<input type="number" class="short" name="begin_d" value="' . $begin_d . '" min="1" max="7">';
        if (empty($conf->dol_use_jmobile)) {
            print ' - ';
        }
        print '<input type="number" class="short" name="end_d" value="' . $end_d . '" min="1" max="7">';
        print '</td></tr>';
    }
    // Hooks
    $parameters = array('canedit' => $canedit, 'pid' => $pid, 'socid' => $socid);
    $reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action);
    // Note that $action and $object may have been
    print '</table>';
    if (!empty($conf->browser->phone)) {
        print '</div>';
    } else {
        print '</td>';
    }
    if (!empty($conf->browser->phone)) {
        print '<div class="fichehalfright">';
    } else {
        print '<td align="center" valign="middle" class="nowrap">';
    }
    print '<table><tr><td align="center">';
    print '<div class="formleftzone">';
    print '<input type="submit" class="button" style="min-width:120px" name="refresh" value="' . $langs->trans("Refresh") . '">';
    print '</div>';
    print '</td></tr>';
    print '</table>';
    if (!empty($conf->browser->phone)) {
        print '</div>';
    } else {
        print '</td></tr></table>';
    }
    print '</div>';
    // Close fichecenter
    print '<div style="clear:both"></div>';
    print '</form>';
}
Exemple #9
0
 $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', 'CRDT');
 print '</td></tr>';
 // Bank Account
 print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
 $form->select_comptes($fk_account, 'fk_account', 0, '', 1);
 print '</td></tr>';
 // Project
 if (!empty($conf->projet->enabled) && $socid > 0) {
     $formproject = new FormProjets($db);
     $langs->load('projects');
     print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
     $formproject->select_projects($soc->id, $projectid, 'projectid');
     print '</td></tr>';
 }
 // Other attributes
 $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by
 // hook
 if (empty($reshook) && !empty($extrafields->attribute_label)) {
     print $object->showOptionals($extrafields, 'edit');
 }
 // Modele PDF
 print '<tr><td>' . $langs->trans('Model') . '</td>';
 print '<td>';
 include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
 $liste = ModelePDFFactures::liste_modeles($db);
Exemple #10
0
 // Commercial suivi
 print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPFOLL") . '</span></td><td>';
 print $form->select_dolusers(GETPOST("commercial_suivi_id") ? GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, '');
 print '</td></tr>';
 // Commercial signature
 print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPSIGN") . '</span></td><td>';
 print $form->select_dolusers(GETPOST("commercial_signature_id") ? GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, '');
 print '</td></tr>';
 print '<tr><td><span class="fieldrequired">' . $langs->trans("Date") . '</span></td><td>';
 $form->select_date($datecontrat, '', 0, 0, '', "contrat");
 print "</td></tr>";
 // Project
 if (!empty($conf->projet->enabled)) {
     $formproject = new FormProjets($db);
     print '<tr><td>' . $langs->trans("Project") . '</td><td>';
     $formproject->select_projects($soc->id > 0 ? $soc->id : -1, $projectid, "projectid", 0, 0, 1, 1);
     print "</td></tr>";
 }
 print '<tr><td>' . $langs->trans("NotePublic") . '</td><td valign="top">';
 $doleditor = new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70);
 print $doleditor->Create(1);
 if (empty($user->societe_id)) {
     print '<tr><td>' . $langs->trans("NotePrivate") . '</td><td valign="top">';
     $doleditor = new DolEditor('note_private', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70);
     print $doleditor->Create(1);
     print '</td></tr>';
 }
 // Other attributes
 $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
 // Note that $action and $object may have been modified by hook
Exemple #11
0
 /**
  *    Show a form to select a project
  *
  *    @param	int		$page        		Page
  *    @param	int		$socid       		Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
  *    @param    int		$selected    		Id pre-selected project
  *    @param    string	$htmlname    		Name of select field
  *    @param	int		$discard_closed		Hide all closed projects
  *    @return	void
  */
 function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0)
 {
     global $langs;
     require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
     require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
     $formproject = new FormProjets($this->db);
     $langs->load("project");
     if ($htmlname != "none") {
         print '<form method="post" action="' . $page . '">';
         print '<input type="hidden" name="action" value="classin">';
         print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
         print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
         print '<tr><td>';
         $formproject->select_projects($socid, $selected, $htmlname, 20, 0, 1, $discard_closed);
         print '</td>';
         print '<td align="left"><input type="submit" class="button" value="' . $langs->trans("Modify") . '"></td>';
         print '</tr></table></form>';
     } else {
         if ($selected) {
             $projet = new Project($this->db);
             $projet->fetch($selected);
             //print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$selected.'">'.$projet->title.'</a>';
             print $projet->getNomUrl(0, '', 1);
         } else {
             print "&nbsp;";
         }
     }
 }
/**
 * Show filter form in agenda view
 *
 * @param	Object	$form			Form object
 * @param	int		$canedit		Can edit filter fields
 * @param	int		$status			Status
 * @param 	int		$year			Year
 * @param 	int		$month			Month
 * @param 	int		$day			Day
 * @param 	int		$showbirthday	Show birthday
 * @param 	string	$filtera		Filter on create by user
 * @param 	string	$filtert		Filter on assigned to user
 * @param 	string	$filterd		Filter of done by user
 * @param 	int		$pid			Product id
 * @param 	int		$socid			Third party id
 * @param	array	$showextcals	Array with list of external calendars (used to show links to select calendar), or -1 to show no legend
 * @param	string	$actioncode		Preselected value of actioncode for filter on type
 * @return	void
 */
function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals = array(), $actioncode = '')
{
    global $conf, $user, $langs, $db;
    // Filters
    print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
    print '<input type="hidden" name="status" value="' . $status . '">';
    print '<input type="hidden" name="year" value="' . $year . '">';
    print '<input type="hidden" name="month" value="' . $month . '">';
    print '<input type="hidden" name="day" value="' . $day . '">';
    print '<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
    print '<table class="nobordernopadding" width="100%">';
    print '<tr><td class="nowrap">';
    print '<table class="nobordernopadding">';
    if ($canedit) {
        print '<tr>';
        print '<td class="nowrap">';
        print $langs->trans("ActionsAskedBy");
        print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
        print $form->select_dolusers($filtera, 'userasked', 1, '', !$canedit);
        print '</td>';
        print '</tr>';
        print '<tr>';
        print '<td class="nowrap">';
        print $langs->trans("or") . ' ' . $langs->trans("ActionsToDoBy");
        print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
        print $form->select_dolusers($filtert, 'usertodo', 1, '', !$canedit);
        print '</td></tr>';
        /*print '<tr>';
        		print '<td class="nowrap">';
        		print $langs->trans("or") . ' ' . $langs->trans("ActionsDoneBy");
        		print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
        		print $form->select_dolusers($filterd, 'userdone', 1, '', ! $canedit);
        		print '</td></tr>';*/
        include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
        $formactions = new FormActions($db);
        print '<tr>';
        print '<td class="nowrap">';
        print $langs->trans("Type");
        print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
        print $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0);
        print '</td></tr>';
    }
    if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
        require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
        $formproject = new FormProjets($db);
        print '<tr>';
        print '<td class="nowrap">';
        print $langs->trans("Project") . ' &nbsp; ';
        print '</td><td class="nowrap maxwidthonsmartphone">';
        $formproject->select_projects($socid ? $socid : -1, $pid, 'projectid', 64);
        print '</td></tr>';
    }
    print '</table>';
    print '</td>';
    // Buttons
    print '<td align="center" valign="middle" class="nowrap">';
    print img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewcal" value="' . $langs->trans("ViewCal") . '">';
    print '<br>';
    print img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewweek" value="' . $langs->trans("ViewWeek") . '">';
    print '<br>';
    print img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewday" value="' . $langs->trans("ViewDay") . '">';
    print '<br>';
    print img_picto($langs->trans("ViewList"), 'object_list', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewlist" value="' . $langs->trans("ViewList") . '">';
    print '</td>';
    // Legend
    if ($conf->use_javascript_ajax && is_array($showextcals)) {
        print '<td align="center" valign="middle" class="nowrap">';
        print '<script type="text/javascript">' . "\n";
        print 'jQuery(document).ready(function () {' . "\n";
        print 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n";
        print 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
        print 'jQuery(".family_birthday").toggle();' . "\n";
        print '});' . "\n";
        print '</script>' . "\n";
        print '<table>';
        if (!empty($conf->use_javascript_ajax)) {
            if (count($showextcals) > 0) {
                print '<tr><td><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda") . '</td></tr>';
                foreach ($showextcals as $val) {
                    $htmlname = dol_string_nospecial($val['name']);
                    print '<tr><td>';
                    print '<script type="text/javascript">' . "\n";
                    print 'jQuery(document).ready(function () {' . "\n";
                    print '		jQuery("#check_' . $htmlname . '").click(function() {';
                    print ' 		/* alert("' . $htmlname . '"); */';
                    print ' 		jQuery(".family_' . $htmlname . '").toggle();';
                    print '		});' . "\n";
                    print '});' . "\n";
                    print '</script>' . "\n";
                    print '<input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val['name'];
                    print '</td></tr>';
                }
            }
        }
        print '<tr><td>' . $langs->trans("AgendaShowBirthdayEvents") . ' <input type="checkbox" id="check_birthday" name="check_birthday"></td></tr>';
        print '</table>';
        print '</td>';
    }
    print '</tr>';
    print '</table>';
    print '</form>';
}
Exemple #13
0
         print img_delete();
         print '</a>';
         print '</td>';
     }
     print '</tr>';
 }
 if ($action == 'editline' && $objp->rowid == GETPOST('rowid')) {
     //modif ligne!!!!!
     print '<tr ' . $bc[$var] . '>';
     // Select date
     print '<td style="text-align:center;">';
     $form->select_date($objp->date, 'date');
     print '</td>';
     // Select project
     print '<td>';
     $formproject->select_projects(-1, $objp->fk_projet, 'fk_projet', 0, 0, 1, 1);
     print '</td>';
     // Select type
     print '<td style="text-align:center;">';
     select_type_fees_id($objp->type_fees_code, 'fk_c_type_fees');
     print '</td>';
     // Add comments
     print '<td>';
     print '<textarea class="flat_ndf" name="comments" class="centpercent">' . $objp->comments . '</textarea>';
     print '</td>';
     // VAT
     print '<td style="text-align:right;">';
     print $form->load_tva('vatrate', isset($_POST["vatrate"]) ? $_POST["vatrate"] : $objp->vatrate, $mysoc, '');
     print '</td>';
     // Unit price
     print '<td style="text-align:right;">';