Siman 343
Presented here for study, not as a practical ruling. The Shulchan Aruch rules by Sephardi custom, the Rema's glosses by Ashkenazi custom, and the Kitzur follows Ashkenazi custom. For a practical question, ask your rabbi.
א מֵת בָּעִיר, כָּל בְּנֵי הָעִיר אֲסוּרִין בִּמְלָאכָה, שֶׁכָּל הָרוֹאֶה מֵת וְאֵינוֹ מְלַוֵּהוּ עַד שֶׁיְּהֵא לוֹ כָּל צָרְכּוֹ, בַּר נִדּוּי הוּא. וְאִם יֵשׁ חֲבוּרוֹת בָּעִיר, שֶׁכָּל אַחַת מִתְעַסֶקֶת בְּמֵתִים בְּיוֹמָהּ, מֻתָּר בְּיוֹם שֶׁאֵינָהּ יוֹמָהּ. בַּמֶּה דְּבָרִים אֲמוּרִים, שֶׁלֹּא בִּשְׁעַת הוֹצָאָתוֹ, אֲבָל בִּשְׁעַת הוֹצָאָתוֹ הַכֹּל בְּטֵלִים, כְּדִלְקַמָּן.
1 [As long as there is] a dead person in town [awaiting burial] all the townspeople are forbidden [to engage] in work. And whosoever sees a corpse and does not attend to all its [burial] needs, is subject to be placed under a ban. However, if there are associations in town, each one of which attends to [the burial needs of] the dead on its [particular] day, it is permissible [for the others who are not required to attend to the burial needs, to engage in work] on the day which is not [appointed] for it [the association]. This applies only to the time when the [funeral] escort was not yet held, but during the [funeral] escort all must abstain from [work] as will be explained infra.
ב בִּכְפָר קָטָן, אֵין שׁוֹאֲלִים שָׁלוֹם זֶה לָזֶה כְּשֶׁהַמֵּת בָּעִיר. הַגָּה: וְכָל שֶׁכֵּן שֶׁאֵין שׁוֹאֲלִים בְּשָׁלוֹם כְּשֶׁיֵּשׁ מֵת עַל בֵּית הַקְּבָרוֹת. (כִּתְבֵי מהר"ר אִסֶרְלָן סִימָן כ"ה בְּשֵׁם סֵפֶר חֲסִידִים), אֲבָל כְּשֶׁאֵין מֵת שָׁם, שׁוֹאֲלִין. בְּרִחוּק אַרְבַּע אַמּוֹת מִן הַקֶּבֶר (בתוס' דְּאִלְפָס פֶּרֶק ג' דמ"ק וְהַכֹּל בּוֹ בְּשֵׁם הר"מ).
2 In a country town one must not extend a greeting of 'peace' to others whilst the corpse is in town. Rema: So much the more that one must not extend a greeting of 'peace' to others when there is a corpse [ awaiting burial ] on the cemetery, but when there is no corpse there, one may extend a greeting of 'peace' to others at a distance of four cubits from the grave.